This is an old revision of the document!
Source: https://unix.stackexchange.com/questions/28803/how-can-i-reduce-a-videos-size-with-ffmpeg
That answer was written in 2009. Nowadays (2020) a video format much better than H.264 is widely available, namely H.265 (better in that it compresses more for the same quality, or gives higher quality for the same size)
# slower, but better (H.264 codec) ffmpeg -i input.mp4 -vcodec libx264 -crf 20 output.mp4 # even better compression with H.265 ffmpeg -i input.avi -vcodec libx265 -crf 20 output.avi # faster, but less compression ffmpeg -i input.mkv -vcodec copy -crf 20 output.mkv