Resize Video While Keeping Quality High with FFmpeg
So my phone camera can actually record video in 1080p and 60 FPS, which is somewhat amazing to me. But I rarely want a minute of footage to weigh in at 200 megabytes when I share it with others. Which means it is time to rescale it down to 480p.
FFmpeg is a tricky beast. I always sit for an hour trying to find the right incantation, the right magical combination of arguments, but once I've found it, it always works beautifully. In this case, the command I wanted was
ffmpeg -i <input_file> -vcodec libx264 -vf scale=852:480 -aspect 16:9 \
-r 60000/1001 -preset slow -crf 18 <output_file>
The libx264
codec is on Ubuntu part of the libavcodec-extra-##
package. Searching for libavcodec
finds it.
I'm putting this here mostly for my own sake, so I don't have to throw an hour at it the next time.