Arun.Stephens
← writing
1 min read

Compressing a screencap with ffmpeg


QuickTime kept making a screencap I recorded on an iPhone way too big. Given that most frames would have had no change to the next, surely it was very compressible. Claude gave me this, and it seems to work. Sharing it here for posterity, also because this was one of the original reasons I had for starting a blog - having a place to store snippets for my own future reference.

ffmpeg -i input.mp4 \
  -vf "scale=-2:1280" \
  -c:v libx264 -preset slow -crf 26 \
  -g 250 -bf 3 -b_strategy 2 \
  -pix_fmt yuv420p \
  -r 30 \
  -an \
  output.mp4

Seems to work well. Enjoy!