3

Android デバイスの画面のビデオをキャプチャしようとしていますが、一部の Samsung デバイスでは、ビデオがピンクの歪みオーバーレイでマスクされています。

下の Samsung DOUS および Pixel XL での出力ビデオのスクリーンショットを確認してください。

Samsung DUOS SM-G532F の場合-Pixel XL 2 (OS レベル 27)

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

メディアレコーダーのセットアップ方法は次のとおりです

    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);

で使用されるデフォルト値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;

そしてその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);
    }

CamcorderProfile.QUALITY_HIGH他のプロファイルも試してみましたが、同じ結果でした

4

1 に答える 1