Closed kaciula closed 1 week ago
Sorry! I'm not quite following your question. Are you saying that sometimes the app crashes after repeatedly pressing record and stop recording?
I've tried recording 13 times, and I haven't encountered the situation you mentioned. Does it require more attempts to happen?
It's not about recording, but about initialization of the camera and the frame rate. It happens if you quickly go back from the camera screen and return and go back again and return. Your example has only one screen so you cannot reproduce it this way.
I see! So now you have two pages switching between each other? And one of them is the recording screen?
Yes. But I don't even start the recording. I just switch back and forth between the pages.
If I comment out the setActiveVideoMinFrameDuration line, it does not crash no matter what I do. But then I don't have any guarantee that the actual frame rate is set to 60 fps.
OK! I'll try to see what you mentioned in a few days.
Hi, Even I am facing this issue every time I use 4k/60fps. I am using an iPhone 14 pro max which supports it.
@kaciula Hi , I uploaded a new file "second_page.dart". I tried creating two pages, but I didn't encounter the issue you mentioned.
@VijayVignesh1 Hi, I also tested it using the iPhone 14 Pro Max at 4K/60fps and didn't encounter any issues.
@kaciula Hi , I uploaded a new file "second_page.dart". I tried creating two pages, but I didn't encounter the issue you mentioned.
@oakleychen0707 You need to add await setCameraConfiguration(720);
after initializing the camera in second_page.dart. I made it crash this way. Go back and forth between main and second page and it crashes.
@kaciula Hi , I uploaded a new file "second_page.dart". I tried creating two pages, but I didn't encounter the issue you mentioned.
@oakleychen0707 You need to add
await setCameraConfiguration(720);
after initializing the camera in second_page.dart. I made it crash this way. Go back and forth between main and second page and it crashes.
@kaciula
Hi, I tried adding the await setCameraConfiguration(720);
you described, and no problems occurred.
Hi. Thank you for sharing the code to set the resolution and frame rate.
However, I've encountered an issue:
If I keep opening and closing the camera screen, after a few times, the app crashes with the following error:
[AVCaptureDevice setActiveVideoMinFrameDuration:] Unsupported frame duration - Supported ranges: ( "<AVFrameRateRange: 0x282eb8f40 1 - 30>" ), tried to set maxFrameRate to 60.000000
But the iphone does support 60fps. It works correctly when I don't keep opening and closing the camera.
Is there a way to improve the code to not crash in this situation?