[camera] MediaSettings parameter for createCameraWithSettings
This PR is for enabling fps and bitrate control of recorded video.
Allow users to more control over recorded video size.
CameraPlatform.createCameraWithSettings is added, leaving original CameraPlatform.createCamera commented as deprecated. So this is not breaking change.
Tested on a set of mobile devices.
Web support depends on browser (perfect with Firefox).
This is main PR. Platform interface's PR is here: #3615
Thanks for the contribution. This is very nice feature to have. Can you share a video capture after this change?
You mean video recorded with this change? I recorded 2, it can be played with chrome or vlc.
-
7 fps, 128000 video bitrate, 32000 audio bitrate, low resolution: https://user-images.githubusercontent.com/8981380/228996631-5e59a802-b351-49e5-be30-4ae3c1f5f9d0.mp4
-
15 fps, 300000 video bitrate, 32000 audio bitrate, low resolution: https://user-images.githubusercontent.com/8981380/228996633-b3976e92-9554-427b-9d94-296f32821dda.mp4
Thanks for the videos. I can tell the FPS, but it's hard to tell the bitrate difference. Can you try even lower bitrate compared with even higher bitrate?
I saw a few update emails in the past few days. Feel free to re-request review (you can do so from the top right corner)
You can easily check stats including bitrate difference using ffprobe:
This is info for first video:

This is info for second video:

@hellohuanlin
I saw a few update emails in the past few days. Feel free to re-request review (you can do so from the top right corner)
I placed re-request some time ago, and now there are not options to re-request:

Thank you for your contribution. It looks like the tests are failing. Please see what you can do to resolve the test failures. If you are unsure how to proceed, please reach out for help on the #hackers-new channel.
@PROGrand Are you still planning on following up on this PR (in particular, all the CI failures)?
We're going to close this to get it off our review queue as it has gone stale, but if you get a chance to update this please feel free to re-open!
@gmackall What needs to be completed to make this merge-able?
@ebjorklund01 The main thing that would need to be completed would be to resolve the test failures. If you can do that, then the review process can proceed! The PR currently has one approval, and would be mergable if it had two approvals and was in a state with all tests passing.
If you're still planning on working on this but aren't sure how to resolve the tests, a good first step would be to re-open and then look at the checks that show at the bottom (below the comments). The failures will be visible and you can follow links to the logs that should help you find the cause of the failures.
Please feel free to reach out in the #hackers-new channel on the discord if you need help or are unsure how to proceed :)
@gmackall Thank you! I'll see what I can do to help bring this over the finish line
@PROGrand Thank you for all the hard work you have put into this pull request. @dsychoi and I will be forking the branch to continue working on the tests to get them passing. If you have any concerns or want to contribute further, please let us know. We appreciate your hard work and look forward to the project's success.
I've closed the draft PR (which was blocking re-opening this one) in favor of this one.
@stuartmorgan Thank you
@gmackall @ebjorklund01 PR is updated. The only test failure is about federated_safety. So, according to https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins, task 1 is done, and 2 is in review process.
It appears that I can only achieve a maximum shooting speed of 60 fps when using the ResolutionPreset.medium. Is there a method to increase this to 120 fps while using the ResolutionPreset.veryHigh? I have tested this on the 13 Pro Max, i get only supported range is 1-30 at veryHigh. By the way, great job!
Will the PR be reviewed soon ? Thanks !
It looks this this still needs:
- initial review of Windows from @cbracken
- re-review of Android by @camsim99
- a response from @PROGrand to the review comment from @ditman about web
@camsim99 https://github.com/flutter/packages/pull/3586#discussion_r1272548722 - Dropped.
@camsim99 https://github.com/flutter/packages/pull/3586#discussion_r1272553488 - refactored safety checks. Now preview can be rendered in paused but initialized state.
I tried the package, with an S22 and the max fps is always 30 frames per second. Is it normal ?
@camsim99 https://github.com/flutter/packages/pull/3586#discussion_r1293672956
Does this require a downgrade? Sorry, I must've thought you were upgrading the version here.
updated to 7.3.0
@PROGrand Thanks for the contribution! This looks like it has the right number of approvals. I think your next step is to break this pr into parts following https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins.
That's already in progress; https://github.com/flutter/packages/pull/3615 was created before this was fully reviewed.
@stuartmorgan I have force pushed #3615, following https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins. Can you review #3615?
camera-platform-interface changes approved (federated-safety related).
@stuartmorgan / @camsim99, can you please make secondary review?
(suggested by @bparrishMines in https://github.com/flutter/packages/pull/3615#pullrequestreview-1629389267)
Also @ditman requested some changes, applied.
@PROGrand is this PR still something you are planning on moving forward with?
@PROGrand is this PR still something you are planning on moving forward with?
@stuartmorgan Federated #5223 is approved by @hellohuanlin (ios) and @camsim99 (android). Waiting for requested @ditman (web) changes approvement.
Hello, is this feature far away from being released? I'm looking forward as I need it in my app :)