Works quite bad for 1080p
anonym24 opened this issue · 2 comments
Though default MediaRecorder works fine with 1080p video resolution
Can this project optimized for higher resolutions as well?
Now I clearly can see lugs
The resolution can go as high as the device's camera can provide for preview. As the resolution goes up the bitrate must keep up to maintain a reasonable video quality. So the time it needs to record a frame goes up too.
Since this project use H.264 TO encode video:
// Use H.264
mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
You can adjust some options to suit your need:
mFrameRecorder.setVideoOption("crf", "23");
mFrameRecorder.setVideoOption("preset", "superfast");
mFrameRecorder.setVideoOption("tune", "zerolatency");
For explainations of these options and instructions of H.264, refer to this.
we just need hardware acceleration support (for android it's MediaCodec)
this issue was recently discussed here bytedeco/javacv#945 (comment)
FFmpeg supports media codec for decoding but unfortunately it doesn't support encoding