Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[camera] change mediaRecorder.setVideoEncodingBitRate for better video quality #1107

Closed

Conversation

divyanshub024
Copy link

@divyanshub024 divyanshub024 commented Jan 23, 2019

closes flutter/flutter#26959

Description

Changing mediaRecorder.setVideoEncodingBitRate from 1024 * 1000 to 3000000 for better quality.

@googlebot
Copy link

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. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@divyanshub024
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@bparrishMines bparrishMines changed the title change mediaRecorder.setVideoEncodingBitRate for better video quality [camera] change mediaRecorder.setVideoEncodingBitRate for better video quality Feb 22, 2019
@bparrishMines bparrishMines added bugfix submit queue The Flutter team is in the process of landing this PR. labels Feb 22, 2019
@Sreejithps
Copy link

I am urgently looking for this fix as we have an upcoming deliverable to a customer. When with this change be rolled out?
Alternately, any pointers to do a local build?

@divyanshub024
Copy link
Author

@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());
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor

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!

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix cla: yes submit queue The Flutter team is in the process of landing this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flutter camera plugin record quality is very poor
7 participants