I'm implementing video recording with Android camera. I use MediaCodec to encode frames from onPreviewFrame() callback.
Now I want to record slow motion video. How can I set the camera capture rate or frame rate? Where can I set these parameters, for example, if I want to record at 120fps, and play at 30fps?
The following is what I have researched:
I recorded a slow-motion video with MOTO X (having built-in slow-motion video recording function) and used FFmpeg to check its fps. I found it records at 110 fps(near 120fps) and playback at 30fps. This proves that it provides hardware support for recording at high fps.
However, when I use getSupportedPreviewFpsRange to check its supported fps range, there are only 4 sets supported fps range with no one greater than 30fps:
min_fps: 15.0 , max_fps15.0
min_fps: 15.0 , max_fps20.0
min_fps: 15.0 , max_fps30.0
min_fps: 24.0 , max_fps30.0
I used setPreviewFpsRange to set the fps higher, but it remains no more than 30fps. I also tried set KEY_FRAME_RATE and KEY_CAPTURE_RATE of MediaFormat. But it still does not work.
I have also searched the solution by setting CamcorderProfile or setVideoFrameRate with MediaRecorder. But I'm doing with MediaCodec.
Can anyone help me with this problem?