FFMPEG Cheat Sheet

This is still a work in progress!


Every FFMPEG command has an input component to it. This is specified by the -i argument.

If you want to cut out only a section of the video, you can use the -ss and -to arguments. However, you have to be aware of keyframes. It may also disallow from doing some copy tricks since that section of the video will have to be decoded (and recompressed if you need to save it somewhere else)

FFMPEG supports all the major codecs. These encoders include:

x264 (libx264)

x265 (libx265)

av1 (libaom or rav1e)

vp8 (outdated but may come into use for very rare cases)

vp9 (still useful)

It also supports many different pixel subsamplings.

Usually x264 and x265 are the most "straightforward" codecs as of now, but vp9 and av1 are quickly ramping up as viable alternatives to MPEG LA and the x26* of codecs.


Simplest command:

ffmpeg-i input.mp4-c:v libvpx-vp9 -c:a copy output.mp4

Two pass encoding (better compression at tradeoff of more time required):

ffmpeg -i input.mp4 -c:v libvpx-vp9 -c:a copy -pass 1 /dev/null && ffmpeg -i input.mp4 -c:v libvpx-vp9 -c:a copy -pass 2 output.mp4