ffmpeg cheatsheet

Convert an image from one format to another

ffmpeg -i INPUT_FILE OUTPUT_FILE
# -q:v 2 sets the quality for output
# Scale from 2-31 with lower numbers equalling higher quality
ffmpeg -i INPUT_FILE -q:v 2 OUTPUT_FILE

Convert a video from one format to another

ffmpeg -i input.mp4 output.avi

Lower the file size of a video

# create a copy of the file encoded with more efficient settings
ffmpeg -i input.mp4 -vcodec libx264 -crf 28 -preset veryslow -acodec aac -b:a 128k output.mp4

Published Apr 11, 2025