[FFmpeg-user] Rotating an mp4 video on Windows

Peter White peter.white at posteo.net
Mon Aug 8 11:34:04 EEST 2016


Elie Grouchko wrote:
 > I have been trying to rotate an mp4 video file on Windows, without
 > affecting the quality, encoding, etc. ...

I believe that is not possible. At least I cannot think of a way of
doing it without re-encoding.

 > ... but the output file is not compatible with WMP.

Yikes! That program from the firm that invented "incompatibilities" to
bind and oppress their customers?!
Maybe give some alternatives a go, generally, like VLC, MPC-HC etc.
I think to remember that at least one of these programs supports
rotating at playback time by means of filters/effects.

 > The command I have been using:
 > ffmpeg -i  source.mp4 -vf "transpose=2" target.mp4

More output would have been nice. But I don't need it to tell you that
this command does affect quality. -vf implies re-encoding, hence
quality loss, unless one uses a lossless codec for the target which
this command does not. And lossless video is rather huge.
But for completeness' sake, a command that rotates and compresses the
video losslessly:

$ ffmpeg -i input.mp4 -vf "transpose=2" -c:v libx264 -crf 0 target.mp4

Just don't come crying about the size of target.mp4. ;)

I think applying filters at playback is the better option. You might
even be able to save a batch file that starts playback with the
filter/effect applied to make it more transparent and less of a
hassle.

 > I tried all the options I have been able to find online, but nothing
 > worked.

If you have done so, why not tell us what you have already tried? ;)
Makes things a whole lot easier.
And just out of pure curiosity and spite I would like to know what
that unholy WMP complains about. :P


Best,
Peter


More information about the ffmpeg-user mailing list