imaginary-cloud / CameraManager

Simple Swift class to provide all the configurations you need to create custom camera view in your app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recorded video Rotates automatically when preview

aiyub007 opened this issue · comments

commented

cameraManager.cameraOutputQuality = .iFrame960x540

using this cameraOutputQuality

When I check in the folder video is a portrait but when I preview the video it gives me landscape always
and for the asset, if portrait video it shows me wrong dimensions [w = 960 x height = 540]
I am facing the issue on ios 14.2 and in iPhone 11

commented
let layerInstruction: AVMutableVideoCompositionLayerInstruction = AVMutableVideoCompositionLayerInstruction(assetTrack: videoTrack)
        if needToApplyFix {
            layerInstruction.setTransform(videoTrack.preferredTransform, at: .zero)
        }

Solved it!!!``