0

我的应用在常规 -> 设备方向设置中被锁定为纵向模式。

我正在使用 AVCam 录制视频,我想同时录制横向和纵向视频。

我尝试了以下方法,并且尝试了其他几种方法,但这无济于事:

当设备旋转时,我设置了预览层方向并开始录制视频。

[[(AVCaptureVideoPreviewLayer *)[[self previewView] layer] connection] setVideoOrientation:(AVCaptureVideoOrientation)toInterfaceOrientation];
4

2 回答 2

2

开始录制视频时设置当前设备方向。

// Update the orientation on the movie file output video connection before starting recording.

[[[self movieFileOutput] connectionWithMediaType:AVMediaTypeVideo] setVideoOrientation:(AVCaptureVideoOrientation)[UIDevice currentDevice].orientation];
于 2015-06-15T10:09:28.663 回答
0

在开始录制之前设置视频输出连接的视频方向。

斯威夫特 3

videoOutput.connection(withMediaType: AVMediaTypeVideo).videoOrientation = AVCaptureVideoOrientation(rawValue: UIDevice.current.orientation.rawValue)!
于 2017-03-23T12:49:43.550 回答