My goal is to write a custom camera view controller that:
- Can take photos in all four interface orientations with both the back and, when available, front camera.
- Properly rotates and scales the preview "video" as well as the full resolution photo.
- Allows a (simple) effect to be applied to BOTH the preview "video" and full resolution photo.
My previous effort is documented in this question. My latest attempt was to modify Apple's sample GLVideoFrame (from WWDC 2010). However, I have not been able to get the iPhone 4 to display the preview "video" properly when the session preset is AVCaptureSessionPresetPhoto.
Has anyone tried this or know why the example doesn't work with this preset?
Apple's example uses a preset with 640x480 video dimensions and a default texture size of 1280x720. The iPhone 4 back camera delivers only 852x640 when the preset is AVCaptureSessionPresetPhoto.
iOS device camera video/photo dimensions when preset is AVCaptureSessionPresetPhoto:
- iPhone 4 back: video is 852x640 & photos are 2592x1936
- iPhone 4 front: video & photos are 640x480
- iPod Touch 4G back: video & photos are 960x720
- iPod Touch 4G front: video & photos are 640x480
- iPhone 3GS: video is 512x384 & photos are 2048x1536
Update
I got the same garbled video result when switching Brad Larson's ColorTracking example (blog post) to use the AVCaptureSessionPresetPhoto.