-
Notifications
You must be signed in to change notification settings - Fork 28.4k
[BUG] [CAMERA] Flutter camera freezes when start recording video on Android #40519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Facing similar error on one of my test Samsung phone (GT N7100) . I have also tried the example flutter camera app Logs when recording started:
At this point the surface is working, I can see things moving. Logs after recording stopped
After recording stopped the surface freezes. Flutter doctor:
More debug info of this phone
|
And the above error comes which @divyanshub024 mentioned is when the
Error Logs:
All this occurred on Samsung (GT N7100) as far I have tested. |
I'm having the same freeze for Pixel 3 with Android Q onboard... |
@troy379 have you tried |
@Sp4Rx Yes, I've tried the |
For me, it works when ResolutionPreset is |
I hope you're not suggesting decreasing the resolution preset is the correct way to counter this bug @divyanshub024 This is something that happens after migrating to the new embedding. I don't know why yet but I'm hopeful @matthew-carroll or someone else from the Flutter team will figure it out. On my Note 10+ it freezes after a couple of seconds moving the camera around. Until this is properly fixed, I guess you need to roll back to a commit before the new embedding commits.
|
@bparrishMines do you happen to know anything about this bug? Do you know if the migrated plugin suffers from this? |
@matthew-carroll @PerLycke It looks like this was reported before the plugin was migrated. I can test it on previous versions to see where it started misbehaving. It may be caused by adding pause and resume functionality or by the resolution fix by @mklim. |
Ok thanks. I did exactly this now to reproduce the issue: Run ml_vision example package together with latest camera source. In the example app I selected CameraPreviewScanner. Took just a couple of seconds for everything to freeze. Tested on the Note 10+. Btw, we have a production app in store with camera sources up to 86d245f with no issues, so it's not the commits you mention @bparrishMines , but something after that. |
@bparrishMines It seems like a different issue from the one OP encountered, I'm not completely sure why I ended up posting it here. I hope my steps to reproduce it above makes sense though. Should I open a new issue? |
Actually never mind. The ml_vision camera streaming seems broken in unmodified state on the Note 10+. I reverted back the camera plugin 6 months and it's still broken, so no recent commits is the cause. We do some lifting of heavy camera tasks to background thread in our production app, and it's working when having these patches. Sorry that I didn't spend more time debugging before coming to this conclusion, I thought the ml_vision / camera streaming was working out of the box. Bottom line: ml_vision camera streaming is not working on the Note 10+. Edit: Opened a new issue for this, as other might experience the same issue. #43566 |
I'm having the same issue as OP, on a Xiaomi A1. From doing a bit of online research, it seems that the cause is flutter camera plugin's usage of android's Camera2 API, which many android devices don't support. I've tested Camera(1) API on the same device and it can record full HD videos. I've come across this library which implements a good fallback to the old Camera API when necessary: https://github.com/infinum/Android-GoldenEye It might be a good direction to follow for solving this problem within the flutter camera plugin. |
After Updating to the latest version (in this case : 0.5.7+4) the video recording works fine for |
same here |
Same issue as OP. Any updates on this flutter team? Camera plugin is turning out to be a real pain and roadblock in using flutter for a production app! |
Hi Team, |
Same here, stop recording always encountered error :
I'm just using Example from camera plugin. |
Same problem. Did anyone find any workarounds? |
I also have it in IOS |
Facing same issue on different devices.
Camera is core feature that many apps use, this needs to fix ASAP. |
Has a solution occurred about this problem? |
I can't think of anything other than migrating to image_picker :( |
Image capturing and video recording working as expected with |
I am testing in Asus Zenfone Max 3 and All Presets are not working Flutter Doctor
Other Info
|
I have a small freeze when i start or stop recording videos with every resolution setting. |
I am trying to reproduce the issue mentioned by the OP but having a hard time doing so on the current version (0.6.3+2). I am trying to reproduce it using the [camera example] App and tested on the following devices (all I have available at the moment):
Can anyone confirm this is still an issue is in the latest versions of the plugin? If so could you supply some information on the device you are testing on (make/ model/ Android version)? |
Hi @mvanbeusekom , All the permissions were granted for the application, required to access the camera. By downgrading to 0.5.7+3, I was able to access the camera in the same application. |
Hi @harshapulikollu, This can happen when you have run To work around this issue you can add a dependency override to your pubspec.yaml file and run a dependency_overrides:
camera_platform_interface: ">=1.0.4 <1.1.0" See also issue #73091 for more details. |
Hi @mvanbeusekom, Thank you for the suggestion, I added the |
@harshapulikollu thank you very much for confirming it now works on the Xiaomi Redmi 5A, that is very helpful to know. @divyanshub024, it's been a long time since you posted this issue, but noticed you are still active in the community, could you maybe confirm if this is still an issue on the latest version of the camera plugin? |
Hey @mvanbeusekom!! Looks like this issue does not occur on the latest version. I'm closing this issue. If anyone faces this issue again then we'll reopen this issue. Thanks!! |
Thanks a lot @divyanshub024! |
I am still facing this issue. bug log is as: I/flutter ( 3986): Error: camera initialized |
@kamleshwebtech could you please share some more information on your environment? The following information would be very helpful:
|
@mvanbeusekom I am new to flutter and the camera plugin but I think I am hitting the same issue. I am using the camera version 0.7.0+2. The camera preview works fine in the emulator by on my device The error I am getting is
Flutter Doctor Output
|
I face the same error with a Samsung SM J730G.
|
It seems that this issue going to be fixed with this PR: flutter/plugins#3651 |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Description
I'm using Flutter camera plugin
camera: ^0.5.4+1
. For some reason, my camera freezes when I start recording video.This is the error I'm getting.
Here is my code of start and stop video recording. The same code use to work before but it's not working now.
Logs
flutter doctor -v
The text was updated successfully, but these errors were encountered: