title: iOS AVFoundation Video Capture Orientation Options
body: <p>I have an app that I would like to have video capture for the front-facing camera only. That's no problem. But I would like the video capture to always be in landscape, even when the phone is being held in portrait.</p>
  
  <p>I have a working implementation based on the AVCamDemo code that Apple published. And borrowing from the information in <a href="http://developer.apple.com/library/ios/#qa/qa1744/_index.html#//apple_ref/doc/uid/DTS40011134" rel="nofollow noreferrer">this tech note</a>, I am able to specify the orientation. There's just one trick: while the video frame is oriented correctly, the contents still appear as though shot in portrait:</p>
  
  <p><img src="https://i.stack.imgur.com/BLzYn.png" alt="landscape orientation with portrait contents"></p>
  
  <p>I'm wondering if I'm just getting boned by the physical constraints of the hardware: is the image sensor just oriented this way? The referenced tech note above makes this note:</p>
  
  <blockquote>
    <p>Important: Setting the orientation on a still image output and movie
    file output doesn't physically rotate the buffers. For the movie file
    output, it applies a track transform (matrix) to the video track so
    that the movie is rotated on playback, and for the still image output
    it inserts exif metadata that image viewers use to rotate the image
    properly when viewing later.</p>
  </blockquote>
  
  <p>But my playback of that video suggests otherwise. Any insight or suggestions would be appreciated!</p>
  
  <p>Thanks,
  Aaron.</p>