Closed oligriffiths closed 3 years ago
[self.view layoutIfNeeded]
before start preview?
You should probably be calling startPreview
on viewWillAppear:
This is just sample code, but yes you are correct, however even with that, the flicker still occurs. In my app im switching the mode whilst the preview is already running, as above (after 3s delay)
thanks @oligriffiths @markst will check it out
Any news about this?
Hey guys, this probably not exactly related to your mode switch issues, but i just want to let you know that you may never solve this problem with modern day hardware and SDK when it comes to mode switching. This plagues all video libraries including GPUImage
If you look on the market, no one is able to achieve this. Even Apple. If you look at most photo capture apps that also do video, they almost always will require the user to do a "mode switch". There is workaround however, if you don't care about the quality of your photos (you're ok with not using AVCaptureSessionPresetPhoto
), for example snapshat, where you can simply take a frame from the live preview buffer #183 without ever having to call a preset change.
There are other "clever" tricks you can do to distract the user, for example, a long "warm up" animation, but from my 5 years trying to accomplish smooth preset changes...it has been futile. The example i'm talking about here is long press to record while single press to capture high resolution photo. It can be done, but not without a very visible hiccup from the hardware.
Up, that's exactly what I did, used #183 to achieve what I'm looking for. Thanks
Hey
First off, great library.
I've found a glitch when switching camera modes. When switching from photo mode to video mode, the preview appears to shrink to around half the size, then flick back to full size again in a split second. Is there any way to mitigate this? It's most noticeable on older hardware (4s) but still visible on iphone 6.
You can test this with the following code: