I have a video that was recorded upside down. Is it possible to correct this with FFmpeg?
Using ffmpeg you have a choice of three video filters to rotate 180°.
Normal and rotated images.
Filtering requires re-encoding. The above example encodes with x264. See the FFmpeg and x264 Encoding Guide for guidance on getting the quality you want.
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 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.