5

It is possible -- indeed, quite easy -- to rotate JPEG-files without re-encoding them, which means, no additional loss of quality is introduced in the process.

Is the same possible for the similarly-lossy video-formats (MPG, MP4)?

1
  • By 90 degrees, and without changing the resolution? E.g. 848x480 would become 480x848? I think that should be possible if the macro blocks etc. are symmetric wrt. vertical/horizontal dimensions, which IIRC they are. But I don't know any tool which would do it. 180 degrees should definitely be possible.
    – dirkt
    Jan 8, 2017 at 8:51

1 Answer 1

18

For some containers (e.g. MOV and MP4) you can set a rotation flag without changing the actual video:

ffmpeg -i input.mp4 -c copy -metadata:s:v:0 rotate=<x> output.mp4

Here, replace <x> with 0 to disable any existing rotation, or any value like 90, 180 or 270 to rotate the displayed video. Note that some players may ignore these flags.

See also: Can I set rotation field for a video stream with FFmpeg?

1
  • Also works with .3gp.
    – Velda
    Aug 2, 2019 at 11:17

Not the answer you're looking for? Browse other questions tagged .