Record video from custom sized AVFoundation?

I am writing a MOV file using AVFoundation but they are not able to figure out how to resize the video. I have the videoGravity property captureVideoPreviewLayer set to AVLayerVideoGravityResizeAspectFill , and the UIView showing the preview layer has its own dimensions (not the same aspect ratio of the screen).

Recording works fine, but the dimensions of the recorded video are the same as the aspect ratio of the screen. How can I record with aspect ratio of UIView or preview level?

+4
source share
1 answer

Here is the best code example for recording video using AVFoundation

https://developer.apple.com/library/ios/#samplecode/RosyWriter/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011110

In the file: RosyWriterVideoProcessor.m

Method name

 - (BOOL) setupAssetWriterVideoInput:(CMFormatDescriptionRef)currentFormatDescription 

In the videoCompressionSettings settings, you can change the measurement, hoping that this will help you.

+3
source

Source: https://habr.com/ru/post/1397146/


All Articles