Capture Video Natively at 4:3 instead of 16:9?

Is it possible to capture video natively at the full frame 4:3 aspect ratio rather than the cropped 16:9 aspect ratio? I know I can capture normal 16:9 then crop it, but I'd prefer to capture as high resolution as possible with the full 4:3 frame size. The video app MAVIS appears to do this and I'm wondering how to implement something like this.


Can someone point me in the right direction?

The app I linked above provides a 4:3 mode without cropping/masking. I'm trying to figure out how they do it.

Accepted Answer

Yes you can record the full resolution of the camera to a movie. AVCaptureMovieFileOutput doesn't support it, but you can do it with AVAssetWriter. Choose your desired AVCaptureDevice's largest format (420v probably) and set it as the device's activeFormat. Create a session with a device input and an AVCaptureVideoDataOutput. In the video data output's sbuf delegate callback, feed the frames into an AVAssetWriter. The AVCaptureVideoDataOutput will even recommend good compression settings to use with the asset writer. Search for "recommendedVideoSettingsForVideoCodecType:assetWriterOutputFileType:" in AVCaptureVideoDataOutput.h. The RosyWriter sample code on the developer website shows how to record a movie using AVCaptureAudioDataOutput, AVCaptureVideoDataOutput, and asset writer. That code could be adapted to capture full res videos.

Thank you!

Capture Video Natively at 4:3 instead of 16:9?
 
 
Q