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

[camera] Set encoding bitrate to recording bitrate (fixes 38787) #2426

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.8+8

* Fixed garbled audio (in video) by setting audio encoding bitrate.

## 0.5.8+7

* Keep handling deprecated Android v1 classes for backward compatibility.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ private void prepareMediaRecorder(String outputFilePath) throws IOException {
// There's a specific order that mediaRecorder expects. Do not change the order
// of these function calls.
if (enableAudio) mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
if (enableAudio) mediaRecorder.setAudioEncodingBitRate(recordingProfile.audioBitRate);
Copy link
Author

@cfchris cfchris Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is it guys. @mklim @tvolkert @BesartLaci @kev2513 @bparrishMines

Do you not trust that this fixes it? Without this change, I couldn't have launched our app (which is in production with hundreds of users on both iOS and Android). Without this change the audio is garbled.

How do we get this merged?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cfchris some of our plugin PRs are in a state where we're transitioning ownership of them from the "core Flutter team" to community owners, and unfortunately, your PR got caught in that transition. I apologize. We'll try to make sure this gets unblocked in the next few days.

If you don't have resolution by next Friday (Oct 9), please ping me, and I'll make sure this is resolved.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @tvolkert !

I know there are a bunch of people that are going to be very happy to have this fixed and switch back to the main repo instead of our various forks.

mediaRecorder.setVideoSource(MediaRecorder.VideoSource.SURFACE);
mediaRecorder.setOutputFormat(recordingProfile.fileFormat);
if (enableAudio) mediaRecorder.setAudioEncoder(recordingProfile.audioCodec);
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera
description: A Flutter plugin for getting information about and controlling the
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
and streaming image buffers to dart.
version: 0.5.8+7
version: 0.5.8+8

homepage: https://github.com/flutter/plugins/tree/master/packages/camera

Expand Down