Lossless Video Rotation using FFmpeg

Lossless Video Rotation using FFmpeg

Rotate videos without losing quality using the effective and simple ffmpeg framework. Here's a quick tutorial to get you started.

Ever realized your phone shot your landscape video in vertical mode? No worries, it's easy to rotate it without losing quality.

How to Rotate Video without Quality Loss

Using the popular video framework ffmpeg we can easily rotate the video

ffmpeg -i input.mp4 -metadata:s:v rotate="90" -codec copy output.mp4

In this example we rotate the video clip input.mp4 a positive 90 degrees and save it as output.mp4 without losing quality at all — the file size is the same. This is possible due to the video rotation only being applied to the video metadata and not the video source information itself.

To get the correct rotation of your video, use the following degrees as a guide:

  • 90 degrees = rotate by a quarter
  • 180 degrees = half rotation
  • 270 degrees = rotate by three quarters
  • 360 degrees = full rotation (no difference to video)

Of course, you also need to change input.mp4 and output.mp4 to your corresponding filenames.

Related items
Categories