I'm looking for a way to rotate videos shot with my Nexus 4 on my Debian Wheezy sytem. The videos are shot in portrait mode and I would like to rotate them to landscape mode. Preferably the rotation is command-line driven.
I have found several previous questions which are hinting at a good solution but I can't seem to manage to get it working.
To begin with there was this question: Rotating videos with FFmpeg
But it indicates that ffmpeg is outdated and that I should use avconv. I found this question detailing the way to go forward. https://askubuntu.com/questions/269429/how-can-i-rotate-video-by-180-degrees-with-avconv
This made me using following command:
avconv -i original.mp4 -vf "transpose=1" -codec:v libx264 -preset slow -crf 25 -codec:a copy flipped.mp4
However, this is painstakingly slow (last test took me more than 6 hours for less than 3 minutes of footage) and does not result in a playable movie. I also get an error in logging output which states Mb Rate > level limit.
Is there an issue here with the re-encoding? Should I first re-encode the videos from my phone to another, more "workable" encoding before applying the rotations? Or am I missing another important point?
ffmpeg
from FFmpeg is not outdated. The fake, counterfeit "ffmpeg
" from Libav (a fork of FFmpeg) is what is outdated. You can not rotate without re-encoding unless: 1) your input is MJPEG, or 2) you rotate upon playback. – Theriot