User:Mjb/FFmpeg

From Offset
< User:Mjb
Revision as of 16:38, 31 January 2014 by Mjb (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Rotate 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: