How to detect if a video file was recorded in portrait orientation, or landscape in iOS

后端 未结 8 1783
孤城傲影
孤城傲影 2020-11-27 02:36

I am using AlAssetsGroup enumerateAssetsAtIndexes to list the assets in the Photos (Camera) app. For a given video asset I want to determine whether it was shot

8条回答
  •  忘掉有多难
    2020-11-27 03:08

    While several of the answers here are correct, they are not comprehensive. For instance, you may also need to know which camera device was used to apply the proper transforms. I created a gist to do this very thing; extract the UIInterfaceOrientation and the AVCaptureDevicePosition.

    Extract AVAsset Orientation and Camera Position

提交回复
热议问题