Fix Android Camera Frame Rate

I want to significantly reduce and set the frame rate for the video on the Android camera - I will consider it as a stream of still frames made faster than the camera setup allows, but much slower than the video. Thus, I would like to change the frame rate and keep it constant.

I know that setPreviewFpsRange (int, int) is the preferred method, passing in the same minutes and max. However, this does not establish a constant frame rate in the face of such things as lighting changes. Given that I’m not trying to get an unstable high frame rate (I actually aim pretty low), is there a way to ensure a constant speed?

+3
source share
1 answer

As you mention setPreviewFpsRange()in your question, I assume that you can use preview permission. In this case, you can slightly change the frame rate by encoding the video yourself. Basically, run it at “normal” speed and capture frames when they enter PreviewCallback. Check the time since the last frame, discard the ones you do not need. Then, when you're done, use something like FFMPEG to encode the video.

This does not guarantee an absolutely constant speed, but you should be able to control it more consistently on different devices, since different devices handle automatic speed changes in a completely different way.

, , , , . , , , .

0

All Articles