-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera] change mediaRecorder.setVideoEncodingBitRate for better video quality #1107
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
I am urgently looking for this fix as we have an upcoming deliverable to a customer. When with this change be rolled out? |
@Sreejithps Check my answer here https://stackoverflow.com/a/54347262/6706175. You have to manually make changes in plugin till it's fixed. |
@@ -464,7 +464,7 @@ private void prepareMediaRecorder(String outputFilePath) throws IOException { | |||
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); | |||
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); | |||
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264); | |||
mediaRecorder.setVideoEncodingBitRate(1024 * 1000); | |||
mediaRecorder.setVideoEncodingBitRate(3000000); | |||
mediaRecorder.setAudioSamplingRate(16000); | |||
mediaRecorder.setVideoFrameRate(27); | |||
mediaRecorder.setVideoSize(videoSize.getWidth(), videoSize.getHeight()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if using existing profiles would be a better option:
mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_480P));
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I implemented a solution using CamcorderProfiles and matching quality between Android and iOS. Comments and suggestions are welcome.
#1403
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's indeed the way to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any update in this case?
closes flutter/flutter#26959
Description
Changing
mediaRecorder.setVideoEncodingBitRate
from1024 * 1000
to3000000
for better quality.