I\'m recording video using AVCaptureSession
with the session preset AVCaptureSessionPreset640x480
. I\'m using an AVCaptureVideoPreviewLayer
Video Resolution and Video Size are two different things. Resolution stands for clarity, higher resolution means higher clarity. Whereas, Video size is the bounds in which to display the video. Depending on the video resolution and aspect ratio of the video, the video will stretch or shrink, when seen in the viewer.
Now as the facts have been explained, You can find Your answer here:
How do I use AVFoundation to crop a video
Perform the steps in this order:
- Record Video to disk.
- Save from Disk to asset library.
- Delete from disk.
- Perform the steps mentioned in the above link.
NOTE: Perform the steps after recording and writing your video to asset library, saveComposition
being the saved asset.
and provide your size in this step:videoComposition.renderSize = CGSizeMake(320, 240);
as videoComposition.renderSize = CGSizeMake(300, 300);
And an advice. Since writing the file to disk, then to library, then again back to disk is kind of a lengthy operation. Try doing it all asynchronously using a dispatch_queue
or operationBlock
Cheers, Have Fun.