Fix Smartphone Video Orientation
The other day I was trying to post some video I took on my iPhone to a WordPress blog. But when I previewed the post the video orientation was sideways. This is not just because I had the phone oriented vertically (which would give you a portrait oriented video as opposed to the usually desired landscape). It’s because most smartphones code their videos in such a way that they play sideways in many media players. Shooting video with the phone’s speaker to your right will usually prevent this from happening but there are exceptions to this rule.
I did a little research and found a way to fix the orientation on afflicted videos so it would appear properly on all media players. The fix is actually quite simple but it involves a command line so those who are faint of heart (when it comes to tech and computing) are warned.
- Download and setup FFmpeg. The instructions are pretty simple and there are versions for all the usual operating systems.
- After your installation is complete run the following from the command line:
ffmpeg -i input_video.mp4 -metadata:s:v rotate="0" -vf "transpose=1" -acodec copy output_video.mp4
where input_video.mp4 is the video you want to correct and output_video.mp4 will be your corrected video.
That’s it! Just two steps (or only one if you already have FFmpeg set up on your computer.
After running the above command line on my video it posted to the WordPress blog perfectly. Now the only thing to remember is to hold the phone right when taking video.
Bonus tip: Need to convert videos (or other files) to other formats? Zamzar, a free online file converter, is an excellent choice. Select the file to convert, the format to convert it to and your email address and they’ll email you a link when the file is done converting. Worried about privacy? The converted file is only kept for 24 hours. I’ve used this service many times to convert .mov files to .mp4. Works every time.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.