Android camera capture gives green and block video

I am trying to record video from a camera in Android, but any output format that I set produces green and block video (albeit with normal sound) ..

So, here are the options I set (I also tried h264 and mpeg_4_sp)

 mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263); 

The native application for capturing the camera saves the video normally (in the settings it is set to h263)

Any idea why this might happen in my application? Are there any other special settings here?

PS: my version of Android that I use for testing is 2.2.1 with BiffMod v2.1

EDIT

Here's what it looks like on Android media players and PCs:

+3
source share
1 answer

Well, I myself solved the problem.

The problem was the resolution of the video, it should be explicitly set to 320x240 (maybe other standard sizes, such as 640x480, are okay too, but it worked just fine for me) therefore recorder.setVideoSize(320,240); solved all green blocky video error

+6
source

All Articles