Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Is it possible to 'lock' the preview frame rate of a camera?

I am trying to create a video recording app that records videos in 24 FPS. I am using the following code in an attempt to lock the FPS to 24:

Camera.Parameters params = mCamera.getParameters();
params.setPreviewFrameRate(24);
params.setPreviewFpsRange(24000, 24000);

And also the following CamcorderProfile that is used with MediaRecorder:

CamcorderProfile ccp = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
ccp.videoFrameRate = 24;

Unfortunately, it only works when the video is taken in low light situation, but once I go outside when there's light, the video starts recording in 30 FPS.

Is it possible to lock the frame rate to 24fps also in broad daylight?

Thanks in advance!

like image 613
MrByte Avatar asked Oct 22 '22 00:10

MrByte


1 Answers

public List<Integer> getSupportedPreviewFrameRates ()

check this list. I suppose that you just cant set frame rate that is not listed there. It may be because of codecs modification that are used in Android OS.

like image 105
Lebedevsd Avatar answered Oct 29 '22 18:10

Lebedevsd