Issue
A friend of mine had a bunch of videos that they had downloaded over the years from several different mediums including from Facebook friends, YouTube Channels or videos from their phone/devices. One of the artifacts of working with some things like cell phones and their rear-facing camera is all of the text and such in the video is backwards, or more appropriately, horizontally flipped. This is fine if you are just making a fun video with your friends but if you need to make an instructional video with a whiteboard that people need to read or if you have other written items in your video that you want people to read, you need to flip the orientation in the video to make it all readable.
Solution
I knew this was something I could fix in FFmpeg but I have to find the right command set to get it oriented correctly. I did a little digging in the docs to find a solution.
The following command will flip the input video horizontally and make a direct copy without doing any other conversion. This appears to be a lossless conversion.
Here's the command:
ffmpeg -i INPUT_FILENAME -vf hflip -c:a copy OUTPUT_FILENAME
While I was in documentation, I went ahead and pulled the commands for some other similar scenarios. Weird things happens with metadata sometimes causing a horizontal video to be vertical or upside-down. Here are some modifications of the above command to handle issues like that as well.
Take upside-down video and make it right-side up:
ffmpeg -i INPUT_FILENAME -vf vflip -c:a copy OUTPUT_FILENAME
Rotate 90 degrees clockwise:
ffmpeg -i INPUT_FILENAME -vf transpose=1 -c:a copy OUTPUT_FILENAME
Rotate 90 degrees counterclockwise:
ffmpeg -i INPUT_FILENAME -vf transpose=2 -c:a copy OUTPUT_FILENAME
Note: Remember to put the Input and Output filenames in quotes if there are any spaces in the filename and give a a fully qualified path to ffmpeg and the filename if you're not in the same folder.