ffmpeg , mediacodec , and mp4parser codecs are taking time to compress, so is there any other way to reduce size of video at time of recording?
I am using MediaRecorder
for recording videos but it creates a lot of data, and I want to reduce it as I'm not able to upload it.
I got my answer with the use of media Recording Documentation and added this lines in code:
mediaRecorder.setVideoEncodingBitRate(1000000);
mediaRecorder.setVideoSize(1280, 720);
mediaRecorder.setOutputFile(folder.getAbsolutePath()+"/"+mediaFileName+".mp4");
mediaRecorder.setPreviewDisplay(surfaceHolder.getSurface());
mediaRecorder.setVideoFrameRate(18);
mediaRecorder.setOrientationHint(mOrientation);
After this, I get a lower size of video with good quality.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.