I'm using Apple's AVCam source code to create a custom camera, its working like a charm, the problem is once I captured a video or image with it, and then checked it into photo library its orientation gets changed to landscape (even I captured it in portrait orientation). I searched a lot for this, but couldn't find a way for this. Any help?
For a note, my app only supports portrait and capturing should only in portrait.
Update:
AVCaptureConnection *captureConnection = ...
if ([captureConnection isVideoOrientationSupported])
{
AVCaptureVideoOrientation orientation = AVCaptureVideoOrientationPortrait;
[captureConnection setVideoOrientation:orientation];
}
This doesn't work.
For capturing image you should set orientation too. When you save image to disk you should use
function and set correct "orientation" parameter there too.
Usage: https://developer.apple.com/library/ios/documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/index.html#//apple_ref/occ/instm/ALAssetsLibrary/writeImageToSavedPhotosAlbum:orientation:completionBlock:
Example on Objective C: