Saturday, 14 July 2018

Screen Recording output get distorted on some Samsung Devices

I'm trying to capture a video of Android devices' screens, but on some Samsung devices, I got the video masked with a pink distortion overlay.

Check the below screenshot of output videos on Samsung DOUS and Pixel XL:

On Samsung DUOS SM-G532F -Pixel XL 2 (OS Level 27)

Samsung DUOS G532F(API 23) - Pixel XL 2 (API 27)

Here is how I setup the Media recorder

    MediaRecorder recorder = new MediaRecorder();
    recorder.setVideoSource(SURFACE);
    recorder.setOutputFormat(MPEG_4);
    recorder.setVideoFrameRate(recordingInfo.frameRate);
    recorder.setVideoEncoder(H264);
    recorder.setVideoSize(recordingInfo.width, recordingInfo.height);
    recorder.setVideoEncodingBitRate(3 * 1000 * 1000);

The default values used in recordingInfo

private static final int DEFAULT_VIDEO_WIDTH = 540;
private static final int DEFAULT_VIDEO_HEIGHT = 960;
private static final int DEFAULT_VIDEO_FRAMERATE = 30;

camcorderProfile.videoFrameWidth = DEFAULT_VIDEO_WIDTH;
camcorderProfile.videoFrameHeight = DEFAULT_VIDEO_HEIGHT;
camcorderProfile.videoFrameRate = DEFAULT_VIDEO_FRAMERATE;

And the CamcorderProfile

CamcorderProfile camcorderProfile;
    if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_TIME_LAPSE_QVGA)) {
        camcorderProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_TIME_LAPSE_QVGA);
    } else {
        camcorderProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
    }

I tried also CamcorderProfile.QUALITY_HIGH and some other profiles and it was the same result



from Screen Recording output get distorted on some Samsung Devices

No comments:

Post a Comment