An .mov video that is upside down in Windows appears right side up in OSX
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:
- Rotate the video on YouTube with its video editor.
-
Rotate the video by re-encoding it on your machine, e.g. with
ffmpeg
, applying thehflip
andvflip
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.
Related videos on Youtube
gardenofwine
Updated on September 18, 2022Comments
-
gardenofwine almost 2 years
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.
-
Karan over 11 yearsMy 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.
-