To pad the video means to add an extra area to the video frame to include additional content. Padding video is often needed, when the input should be played on a display with a different aspect ratio
For example, to create a 30-pixel wide pink frame around an SVGA-sized photo, we can use the command
ffmpeg -i photo.jpg -vf pad=860:660:30:30:pink framed_photo.jpg
Padding videos from 4:3 to 16:9
ffmpeg -i input -vf pad=ih*16/9:ih:(ow-iw)/2:0:color output
For example, without knowing the exact resolution of the film.mpg file with 4:3 aspect ratio, we can add so-called pillarboxes in a default black color with the command
ffmpeg -i film.mpg -vf pad=ih*16/9:ih:(ow-iw)/2:0 film_wide.avi
Padding videos from 16:9 to 4:3
ffmpeg -i input -vf pad=iw:iw*3/4:0:(oh-ih)/2:color output