title: Nexus 5X records video rotated upside down using MediaRecorder and camera2
body: <p>I'm facing the problem with recording video by new camera2 api. I'm playing with project from 
  <a href="https://github.com/googlesamples/android-Camera2Video" rel="nofollow">https://github.com/googlesamples/android-Camera2Video</a>
  which demonstrates video recording using new camera2 api. Recording works well but rotation of recorded mp4 video is different because of different devices.</p>
  
  <p>Nexus 9 result video is fine but Nexus 5X not.</p>
  
  <p><strong>I've heard that Nexus 5X has camera rotated upside down</strong>. In this case I would set MediaRecorder flags to record properly but...</p>
  
  <p><strong>My question is, how to recognize programmatically whether device has or doesn't have camera rotated upside down?</strong></p>
  
  <p>Thanks for any help!</p>