packages icon indicating copy to clipboard operation
packages copied to clipboard

[camera] MediaSettings parameter for createCameraWithSettings

Open PROGrand opened this issue 2 years ago • 34 comments

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).

PROGrand avatar Mar 29 '23 22:03 PROGrand

This is main PR. Platform interface's PR is here: #3615

PROGrand avatar Mar 29 '23 23:03 PROGrand

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

PROGrand avatar Mar 31 '23 01:03 PROGrand

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?

hellohuanlin avatar Mar 31 '23 23:03 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)

hellohuanlin avatar Apr 03 '23 17:04 hellohuanlin

You can easily check stats including bitrate difference using ffprobe:

This is info for first video: image

This is info for second video: image

PROGrand avatar Apr 04 '23 13:04 PROGrand

@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: image

PROGrand avatar Apr 04 '23 13:04 PROGrand

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.

reidbaker avatar May 04 '23 18:05 reidbaker

@PROGrand Are you still planning on following up on this PR (in particular, all the CI failures)?

stuartmorgan-g avatar May 16 '23 20:05 stuartmorgan-g

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 avatar May 25 '23 18:05 gmackall

@gmackall What needs to be completed to make this merge-able?

ebjorklund01 avatar May 25 '23 18:05 ebjorklund01

@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 avatar May 25 '23 19:05 gmackall

@gmackall Thank you! I'll see what I can do to help bring this over the finish line

ebjorklund01 avatar May 25 '23 20:05 ebjorklund01

@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.

ebjorklund01 avatar May 31 '23 17:05 ebjorklund01

I've closed the draft PR (which was blocking re-opening this one) in favor of this one.

stuartmorgan-g avatar Jun 06 '23 11:06 stuartmorgan-g

@stuartmorgan Thank you

PROGrand avatar Jun 06 '23 11:06 PROGrand

@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.

PROGrand avatar Jun 06 '23 13:06 PROGrand

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!

deucks avatar Jun 19 '23 18:06 deucks

Will the PR be reviewed soon ? Thanks !

yassinekassis avatar Jul 22 '23 14:07 yassinekassis

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

stuartmorgan-g avatar Jul 24 '23 15:07 stuartmorgan-g

@camsim99 https://github.com/flutter/packages/pull/3586#discussion_r1272548722 - Dropped.

PROGrand avatar Aug 04 '23 05:08 PROGrand

@camsim99 https://github.com/flutter/packages/pull/3586#discussion_r1272553488 - refactored safety checks. Now preview can be rendered in paused but initialized state.

PROGrand avatar Aug 04 '23 05:08 PROGrand

I tried the package, with an S22 and the max fps is always 30 frames per second. Is it normal ?

yassinekassis avatar Aug 14 '23 19:08 yassinekassis

@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 avatar Aug 15 '23 17:08 PROGrand

@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.

reidbaker avatar Aug 24 '23 18:08 reidbaker

That's already in progress; https://github.com/flutter/packages/pull/3615 was created before this was fully reviewed.

stuartmorgan-g avatar Aug 25 '23 18:08 stuartmorgan-g

@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?

PROGrand avatar Sep 04 '23 17:09 PROGrand

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 avatar Sep 19 '23 10:09 PROGrand

@PROGrand is this PR still something you are planning on moving forward with?

stuartmorgan-g avatar Dec 12 '23 20:12 stuartmorgan-g

@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.

PROGrand avatar Dec 13 '23 13:12 PROGrand

Hello, is this feature far away from being released? I'm looking forward as I need it in my app :)

evaboen avatar Jan 19 '24 14:01 evaboen