all 2 comments

[–]In-the-clouds[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

In my garden I was surprised to see that a dragonfly had caught a moth and was chewing into its back. I grabbed my cell phone and recorded a video, but when I played the video on my computer, it was rotated 90 degrees. The tool ffmpeg was able to rotate it. The code is below. And you can see the resulting video: dragonfly eating a moth.

$ ffmpeg -i <input> -c:a copy -b:v 25M -vf "transpose=1" <output>

Explanation

-c:a copy copies audio so it is not re-encoded

-b:v 25M sets bitrate

-vf "transpose=1" rotates video 90 degrees

To convert all files in a folder:

$ for f in *; do ffmpeg -i "$f" -c:a copy -b:v 25M -vf "transpose=1" "$f"_transposed.mp4; done

[–]transbob 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (0 children)

There's about a million tutorial videos for ffmpeg on YouTube..

You can do literally anything with FFM peg.. you can rotate you can transition you can change the contrast you can insert frames you can delete frames..

Ffmpeg can do almost anything.