How to Pad 4:3 Video to 16:9 with FFmpeg

This guide explains how to convert a 4:3 aspect ratio video into a 16:9 widescreen format by adding black bars (pillarboxing) using FFmpeg’s pad filter. You will learn the exact command-line syntax, how the mathematical formula behind the filter works, and how to scale and pad your video to a specific standard resolution like 1080p.

The Basic Pad Command

To add black bars to the left and right of a 4:3 video without altering its height or re-scaling the source, use the following FFmpeg command:

ffmpeg -i input.mp4 -vf "pad=ih*16/9:ih:(ow-iw)/2:(oh-ih)/2" -c:a copy output.mp4

This command processes the video stream with the video filter (-vf), applies the padding, and copies the audio stream (-c:a copy) without re-encoding it to save time.

How the Pad Filter Parameters Work

The pad filter uses the syntax pad=width:height:x:y:color. In the command above, these variables are defined dynamically using FFmpeg’s internal constants:

Scaling and Padding to a Specific Resolution (e.g., 1080p)

If you need the output video to fit a standard widescreen resolution, such as Full HD (1920x1080), you must combine the scale and pad filters in a single filterchain.

For a 4:3 video, scaling the height to 1080 pixels results in a width of 1440 pixels. You then pad the width to 1920 pixels:

ffmpeg -i input.mp4 -vf "scale=1440:1080,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" -c:a copy output.mp4

In this command: 1. scale=1440:1080 resizes the input video to 1440x1080 (maintaining the 4:3 aspect ratio). 2. pad=1920:1080:(ow-iw)/2:(oh-ih)/2 places the scaled video inside a 1920x1080 frame and centers it, automatically generating 240-pixel-wide black bars on both the left and right sides.