| README.md | ||
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.