Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid MediaRecorder produces corrupt video with green lines
    primarykey
    data
    text
    <p>I'm trying to add video recording capability to my app using MediaRecorder in Android, but the resulting video looks corrupt with green lines (audio is fine). The following code is what I use to initialize the MediaRecorder object:</p> <pre><code>mMediaRecorder = new MediaRecorder(); mCamera.unlock(); mMediaRecorder.setCamera(mCamera); mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); mMediaRecorder.setOutputFile(Utility.CAPTURE_VIDEO_FILENAME); mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263); mMediaRecorder.setMaxDuration(60000); mMediaRecorder.setVideoFrameRate(20); mMediaRecorder.setMaxFileSize(5000000); mMediaRecorder.setVideoSize(352, 288); mMediaRecorder.setPreviewDisplay(mPreview.mHolder.getSurface()); mMediaRecorder.prepare(); mMediaRecorder.start(); </code></pre> <p>I've already looked at the suggestions <a href="https://stackoverflow.com/questions/4889579/android-camera-capture-produces-green-and-blocky-video">here</a> and <a href="http://integratingstuff.com/2010/10/18/writing-code-that-captures-videos-on-android/" rel="nofollow noreferrer">here</a>, but they don't seem to help my cause. I do think, however, that it might have something to do with incorrect video size. So my question is this: is there any good way to get compatible video sizes when using API level 7? As far as I can tell I can use CamcorderProfile if I'm in API level 8, but nothing in 7.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload