scripts:ffmpeg:rotate_video_with_metadata

Rotate a video using only metadata

You did it again. You started filming a video on your phone in portrait and turned it landscape 1 second later.
Now your whole video appears portrait and you're lookin at your screen funny rotating your head.

Fear not, you don't even need to actually re-encode anything, just soft rotate all your files.

Here's what I do to batch convert a folder of MOVs from my camera which had the wrong orientation into an mkv rotated 90.

parallel --ungroup -j 8 -q ffmpeg -display_rotation 90 -i "{}" -c copy -y "{.}.mkv" ::: *.MOV

Note, this just changes metadata, not the video stream, so players that don't respect that won't care.

  • scripts/ffmpeg/rotate_video_with_metadata.txt
  • Last modified: 2025-01-03 05:44
  • by Tony