Windows – An .mov video that is upside down in Windows appears right side up in OSX

iphonemacosvideowindows 7

I have an MacBookPro with Windows installed via BootCamp. I copied a video off the iPhone and saved it on the windows partition. The thumbnail of the video looks upside down. When I play it in Windows Media Player or VLC, the video looks upside down. When I play it in the QuickTime player (still on Windows), it looks right side up.

I then boot into MacOS. The thumbnail looks right side up and when I play it it looks right side up.

So what is going on – which app/os is telling me the truth? I want to make sure because I want to upload it to youTube and the file is huge, so don't feel like wasting time/bandwidth.

P.S. EDIT: Just like a couple of folks pointed out – some programs are ignoring the orientation tag. I tried it on Windows 8 and all programs seem to respect the tag (including Windows Media Player and Movie Maker and Video applet in Metro screen). So good progress.

Best Answer

Videos that come from rotated iPhones have a rotate attribute.

If the video appears upside down in standard players that don't respect this attribute, that means it actually is upside down and the attribute is set to 180.

You can remove the rotation flag altogether, e.g. with ffmpeg:

ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate=0 output.mp4

This will just alter the metadata and won't re-encode the video. Now, your video should play upside down in any player.

Of course, if you want to upload it to YouTube, it'll appear upside down. You now have two choices:

  1. Rotate the video on YouTube with its video editor.
  2. Rotate the video by re-encoding it on your machine, e.g. with ffmpeg, applying the hflip and vflip filters:

    ffmpeg -i input.mp4 -c:v libx264 -filter:v "hflip,vflip" -c:a copy output.mp4
    

    You may want to add the -crf 20 option after -c:v libx264 to force a higher quality, since re-encoding the video will diminish its quality to some extent. Lower CRF parameter means better quality, and normally you'd use values from 18 to 28. 23 is default.