A small collection of ffmpeg commands I regularly use
Find a file
2026-07-25 09:08:50 +00:00
README.md Update README.md 2026-07-25 09:08:50 +00:00

ffmpeg-cheat-codes

A small collection of ffmpeg commands I regularly use

AV1

ffmpeg -i input.mp4 -c:v libsvtav1 out.mp4

Note: You can use webm and mkv too, instead of mp4. All three are supported.

Constant Rate Factor

ffmpeg -i input.mp4 -crf 32 out.mp4

Note: Not really sure what to say here, other than CRF essentially determines the bitrate for your video. Higher values == more artefacts (lower file size)

Scale

ffmpeg -i input.mp4 -filter:v scale=-1:720 out.mp4

Note: Scales the video up/down, depending on the original resolution, to the desired height (in pixels), while keeping the aspect ratio.

Video From Multiple Images

ffmpeg -framerate 30 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p out.mp4

Note: -pattern_type glob -i '*.jpg' <-- This is all of the jpg's in your folder. You can use png too. I don't think .avif is supported, as I couldn't make it work. I also don't know if -pix_fmt yuv420p is necessary.

Multiple Images From Video

ffmpeg -i input.mp4 -q:v 1 %06d.jpg

Note: -q:v 1 is just to get the best quality jpg as possible. %06d is the naming pattern. 06 means that there will be six zeros. The image filenames will look like this: 000001.jpg, 000002.jpg, 000003.jpg, ... and so on.