Wrong Video Aspect Ratio

Hello.

I'm having problems with a narrow video aspect ratio displayed on an iPad Air.

In an outlet labeled ImagePreviewOutlet I want to display a video feed from the iPad camera facing the user. So basically the user will see their own face. I did all the necessary moves in the Story Board and in the code and I got what I wanted. Except it is in the wrong Aspect Ratio. The image doesn't fill the screen of the iPad even though the dimensions of the ImagePreviewOutlet does. It's narrow, showing white space on either side of the video. I want a wider aspect ratio. I understand that the iPad has 2 ratios : 4:3 and 16:9.

Can anybody help me? I can supply the code that I'm using but I don't want my first post to be overwhelming.

Thank you for your time.

JR

Hello JR,

It's not clear to me what view type your "ImagePreivewOutlet" actually is, but in general I recommend utilizing AVCaptureVideoPreviewLayer to preview a camera stream. This layer automatically takes care of aspect ratio concerns (via it's videoGravity property).

Wrong Video Aspect Ratio
 
 
Q