User:Mjb/FFmpeg
From Offset
Jump to navigationJump to searchRotate 180 degrees
When you hold a camera phone the wrong way, it will just put a ROTATION=180 flag in the metadata, which not all players will support. To actually rotate the video, chain the hflip and vflip filters:
ffmpeg -i inputfile -vf "vflip,hflip" outputfile
The rotation flag will not be changed when you do this, so you can set it afterward (assumes video is stream # 0):
ffmpeg -i inputfile -c copy -metadata:s:v:0 rotate=0 outputfile
Or you can do both at the same time (untested):
ffmpeg -i inputfile -vf "vflip,hflip" -metadata:s:v:0 rotate=0 outputfile
Reference: