CamcorderProfile.QUALITY_HIGH resolution produces green flickering video

I came across this question trying to solve the same problem.

A solution is given over on xda developer http://forum.xda-developers.com/showthread.php?t=1104970&page=8. It seems that you need to set an obscure parameter “cam_mode” for high definition recording to work:

camera = Camera.open();
Camera.Parameters param = camera.getParameters();
param.set( "cam_mode", 1 );     
camera.setParameters( param );

In mediarecorder, you can then use

mediarecorder.setVideoSize(1920, 1080);

although this will now also work:

mediarecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));

(The latter seems to have a video bitrate of 20Mb/s, so you might want to take that down a bit!) I found that I didn’t have to set the preview size to 1920×1080.

(edit) You also need to set

parame.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);

or

param.setFocusMode(Camera.Parameters.FOCUS_MODE_INFINITY);

otherwise you get a delay of a few seconds before the camera starts!

As to why Samsung has implemented the Camera in this way, I have no idea. It’s certainly not developer friendly!

Leave a Comment