ffmpeg Cheat Sheet

ffmpeg is a video encoder for linux. This tool is very versatile and can do pretty much any kind of video processing all from the console.

As with any linux tool, there a tons of bells and whistles. This makes the learning curve kind of steep, but with a bit of determination anyone can make sense of it. Without further ado, here’s the cheat sheet:

ffmpeg -i clip1.avi -i clip2.avi -vcodec copy -acodec copy new-clip.aviCopies clip1 and clip2 into new-clip.avi
ffmpeg -i clip.avi -vcodec libxvid -b 800000  -acodec libmp3lame -ab 128 new-clip.aviEncodes a clip with the xvid codec at 800Kbps and mp3 audio at 128Kbps.
ffmpeg -i clip.avi -t 00:05:00 -vcodec copy -acodec copy new-clip.aviCopies the first 5 minutes from clip.avi into new-clip.avi
ffmpeg -i clip.avi -t 00:05:00 -ss 60 -vcodec copy -acodec copy new-clip.aviCopies 5 minutes from clip.avi into new-clip.avi, skipping the first minute.
ffmpeg -i clip.avi -s 640:576 -vcodec libxvid -b 1200000 -acodec copy -o new-clip.aviResizes the video to 640×576, then encoding video using xvid at 1200Kbps and copying the audio directly
ffmpeg -i clip.avi -target ntsc-dvd -b 5000000 dvd-clip.mpegEncodes clip.avi into a dvd-compatible mpeg at 5000Kbps