4

I am recording an MOV file using AVFoundation but im having trouble finding out how to change the dimensions of the video. I have videoGravity property of captureVideoPreviewLayer set to AVLayerVideoGravityResizeAspectFill and the UIView showing the preview layer has custom 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 the aspect ratio of the UIView or the preview layer?

KDaker
  • 5,899
  • 5
  • 31
  • 44

1 Answers1

3

Here is best sample code to record video using AVFoundation

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

In File: RosyWriterVideoProcessor.m

Method Name

- (BOOL) setupAssetWriterVideoInput:(CMFormatDescriptionRef)currentFormatDescription

In videoCompressionSettings you can change dimension, hope this will help you.

DD_
  • 7,230
  • 11
  • 38
  • 59
Kamleshwar
  • 2,967
  • 1
  • 25
  • 27