Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
1  
My guess is the video has an orientation flag (just like the EXIF orientation flag for JPGs) which WMP and VLC are ignoring, but obviously QT player knows about given it's also an Apple product. I'm not sure how YT will deal with it though. –  Karan Mar 25 '13 at 4:59

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.