You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I set the videoCodecType to .h264 in viewDidLoad the video records in h264. But If I call switchCamera then the video records as HVEC.
From what I can tell it's because the codec selection doesn't persist after the session inputs change in switchCamera and defaults back to HVEC. I thought I could just set videoCodecType either before or after switching the camera via switchCamera, but that appears to have no effect. After switching the codec is always HVEC.
It looks like configureVideoOutput (where videoCodecType comes into play) is called only in viewDidLoad, maybe it should be called in switchCamera too or at least some of its logic needs to be present in switching the camera perhaps.
Seems like a workaround for now is to persist the current camera state (front or back) and then reload the view entirely with the new state. But thought I would let you know what I'm seeing. Maybe I'm missing a different way to make it work without reloading the view. Thanks!
The text was updated successfully, but these errors were encountered:
Seems like my issue may be a duplicate of this #208 or at least @ShaikBaji1506 is having the same problem of the codec not being carried over when switching cams.
I'm able to solve this by reloading the view controller entirely when switching camera and setting the desired camera using the defaultCamera property, and then calling super.viewDidLoad which applies the codec I select (.h264) to the session, but I do think it's a bug if switchCamera always ends up with HVEC so I'll leave the issue open in the hopes that it can be fixed.
I set the
videoCodecType
to.h264
inviewDidLoad
the video records in h264. But If I callswitchCamera
then the video records as HVEC.From what I can tell it's because the codec selection doesn't persist after the session inputs change in
switchCamera
and defaults back to HVEC. I thought I could just setvideoCodecType
either before or after switching the camera viaswitchCamera
, but that appears to have no effect. After switching the codec is always HVEC.It looks like
configureVideoOutput
(where videoCodecType comes into play) is called only in viewDidLoad, maybe it should be called inswitchCamera
too or at least some of its logic needs to be present in switching the camera perhaps.Seems like a workaround for now is to persist the current camera state (front or back) and then reload the view entirely with the new state. But thought I would let you know what I'm seeing. Maybe I'm missing a different way to make it work without reloading the view. Thanks!
The text was updated successfully, but these errors were encountered: