Preview Layer Orientation - iOS
NickName:neeraj Ask DateTime:2012-10-26T13:12:26

Preview Layer Orientation - iOS

I have a preview layer which shows the camera preview, using AVFoundation. Now I want to start my app such that everything is in landscape mode. How do I do that for the preview layer?

setorientation: method is deprecated for iOS 6 so I don't want to use that.

The setVideoOrientation method of AVCaptureConnection changes the actual way the images are captured but the preview orientation still remains the same.

Copyright Notice:Content Author:「neeraj」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13081080/preview-layer-orientation-ios

More about “Preview Layer Orientation - iOS” related questions

Preview Layer Orientation - iOS

I have a preview layer which shows the camera preview, using AVFoundation. Now I want to start my app such that everything is in landscape mode. How do I do that for the preview layer? setorienta...

Show Detail

AVCaptureSession preview screen orientation in iOS5

I asked this question a while back. I accepted the answer because it worked... until I tried it out on iOS5. My app is landscape only. Opening the camera preview and holding the device with the h...

Show Detail

UIImagePickerController live preview orientation wrong

I have a landscape iPad app and I present a UIImagePickerController with sourcetype UIImagePickerControllerSourceTypeCamera to my active view controller modally. However, the live preview is in the...

Show Detail

OpenCv iOS camera preview single orientation only without stretching

I'm writing a OpenCv Cordova plugin for iOS. I needed the camera preview to be fullscreen and to maintain aspect ratio for all iOS devices (iPhone, iPads). I was able to achieve Portrait mode (see...

Show Detail

IOS Preview in landscape with correct zoom

Who can give me an minimal example in IOS 5 or higher of an app that captures the video of the backside cam with the following requirements: The resolution of the image captured by the camera is

Show Detail

AVCaptureConnection videoOrientation AVCaptureConnectionPreviewlayer orientation iOS

I am trying to make an app which shows camera preview, and clicks an image when pressed a button. I wanted to rotate the preview when the device was rotated, so i was using Till now I was using

Show Detail

Rotate Video Preview Layer according to Device orientation. Xcode Swift

I have been trying to get my live video feed (camera Preview Layer) to rotate orientations when the device is rotated. I am completely stuck. I have provided my current code below. Note: this app ...

Show Detail

only detect in a section of camera preview layer, iOS, Swift

I am trying to get a detection zone in a live preview on my camera preview layer. Is it possible for this, say there is a live feed and you have face detect on and as you look around it will only ...

Show Detail

Capturing image that exists within video preview layer

I'd like to capture only the image within the video preview layer. Currently, I set it like this: [self setCaptureManager:[[[CaptureSessionManager alloc] init] autorelease]]; [[self captureManager]

Show Detail

Video Preview Layer Running While in Split-View?

I currently have an app that displays the front facing camera atop a video preview layer. By default in iOS 9, the preview layer is interrupted/paused and will not resume until split-view is dismis...

Show Detail