C.W.K.
Stream
Lesson 04 of 10 · published

Pad

~8 min · pad, letterbox, border

Level 0Viewer
0 XP0/73 lessons0/15 achievements
0/100 XP to next level100 XP to go0% complete

Adding pixels around your video

pad=W:H:X:Y:color. W and H are the new canvas dimensions; X and Y are where the original goes (top-left). color is the fill (default black).

Common patterns

  • Letterbox 4:3 → 16:9 → pad=1920:1080:(ow-iw)/2:(oh-ih)/2 with the original scaled into the inner region.
  • Border for thumbnailspad=iw+40:ih+40:20:20:color=white
  • Pillarbox — vertical content padded to horizontal canvas.

Code

Pad recipes·bash
# Letterbox 4:3 → 16:9 (keeps content, adds black bars left/right)
ffmpeg -i in_4_3.mp4 \
  -vf "scale=1440:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:color=black" \
  -c:v libx264 -crf 20 letterboxed.mp4

# 9:16 vertical → 16:9 horizontal (pillarbox with blurred background)
ffmpeg -i vertical.mp4 \
  -filter_complex "[0:v]scale=1920:1080:force_original_aspect_ratio=increase,gblur=sigma=20[bg]; \
                   [0:v]scale=-2:1080[fg]; \
                   [bg][fg]overlay=(W-w)/2:0[outv]" \
  -map "[outv]" -map 0:a -c:v libx264 -crf 20 -c:a copy fancy.mp4

External links

Exercise

Take a vertical 9:16 phone video. Convert it to a 16:9 1920×1080 with: (a) plain black pillarbox, (b) blurred-background pillarbox using the recipe above. Compare on YouTube/Instagram — which looks more 'native' to a horizontal feed?

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.