I have a video that was recorded upside down. Is it possible to correct this with FFmpeg?
This filter can rotate to any arbitrary angle and uses radians as a unit instead of degrees. This example will rotate π/1 radians, or 180°:
You can use degrees instead. One degree is equal to π/180 radians. So if you want to rotate 45°:
Rotate upon playback
Alternatively you can rotate upon playback and avoid re-encoding:
...or refer to your favorite player. Most players worth using, like VLC, have this capability.
Media players that use ffmpeg as a decoding backend can also utilize all of its filters. See this screenshot with "Offset & flip" filter.
Alternatively, if you want to re-encode your video, check out Rotating videos with FFmpeg on Stackoverflow.
Following is a bash script which will output the files with the directory structure under "fixedFiles". It transforms and rotates iOS videos and transcodes AVIs. The script relies on having installed both exiftool and ffmpeg.
Here are the steps:
Choose the file settings you want to export as and click “Ok”, to kick off the export.
When the export operation is complete, you’ll find your new file where ever you chose to save it with the correct orientation!
This whole fix took me less than 5 minutes to complete, but depending on the length of the video, it could take much longer (or shorter, again, it varies).