ffmpeg -i input.mp4 -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" output.mp4

Category: Media & Conversion

ffmpeg -i input.mp4 -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" output.mp4

Scale and letterbox video to a fixed size

Fits the video inside 1280x720 with black bars rather than stretching it. force_original_aspect_ratio=decrease shrinks it to fit, and pad fills the rest while (ow-iw)/2 centers the image. The comma chains two filters in one -vf graph.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.