title: Mp4 video rotation metadata
body: <p>I have developed an android/ios video sharing app that records a video and uploads it to amazon s3. For compatibility both android/ios record in mp4 format with H264/AAC codecs. </p>
  
  <p>The users might shoot portrait or landscape and the app, getting info from the sensors, set the rotation of the file (mediarecorder.setOrientationHint on android and something similar on iOS)</p>
  
  <p>The videos from iOS play fine on android and vice versa. The problem is when i want to play a video on a web browser. The browsers that support mp4 format (ie, chrome) display the video but ignore the rotation metadata. The same thing happens when i playback those videos with mplayer on linux.</p>
  
  <p>The first solution that comes to mind is</p>
  
  <pre><code>ffmpeg -i in.mp4 -vf transpose=&lt;rotation value&gt; out.mp4
  </code></pre>
  
  <p>Is there a reason why browsers ignore rotation metadata? Is it a bug? Could i do something to fix this while recording the video?</p>
  
  <p>Here are 2 sample from iOS and android respectively.</p>
  
  <p>Thansk</p>
  
  <p><a href="https://dzlf1jjn1x4to.cloudfront.net/peeks/ed0df56f37a721fa4ba29b8c24a31660b186d978.mp4" rel="noreferrer">ios video</a>
  <a href="https://dzlf1jjn1x4to.cloudfront.net/peeks/3b5b4e88609e52780431442b52a93c28dd94a40a.mp4" rel="noreferrer">android video</a></p>