FFMPEG COMMAND

Make a video vertical (9:16) with FFmpeg

A landscape video does not fit a phone screen; you either fill the empty space (blurred copy of the video or black) or cut the sides. The blurred version is the primary command because it keeps the whole picture and looks like a native post; crop and pad follow.

Verified with FFmpeg 9.0.1 on 26 August 2026. Search intent: ffmpeg 9:16 vertical video.

the command
ffmpeg -i input.mp4 -filter_complex "[0:v]split[bg][fg];[bg]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=20:10[bgb];[fg]scale=1080:-2[fgs];[bgb][fgs]overlay=(W-w)/2:(H-h)/2" -c:v libx264 -crf 23 -preset medium -c:a copy vertical.mp4

Splits the video in two: the background copy is scaled to cover 1080x1920, cropped and blurred; the foreground is scaled to 1080 px wide (608 px high for 16:9) and centred on top. The 1920x1080 test file became a 1080x1920 file of 2.2 MB, audio copied.

Flags, explained

split[bg][fg]
Duplicate the decoded video into two labelled streams so one can be blurred and the other kept sharp.
scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920
Scale until the picture covers the target box, then cut it to exactly 1080x1920. This is the cover-fit behaviour of CSS.
boxblur=20:10
Blur radius 20 applied 10 times on the background. Heavier values cost time; 20:10 is enough to hide detail.
scale=1080:-2
Fit the sharp copy to the full width with an even height (608 px for 16:9).
overlay=(W-w)/2:(H-h)/2
Centre the sharp copy on the blurred background.
pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black
Add black borders to reach 1080x1920 with the picture centred.
-profile:v high -level 4.1 -r 30 -g 60 -movflags +faststart
Encoder constraints commonly listed by Instagram, TikTok and YouTube: High@4.1, constant frame rate, 2 s GOP, moov atom first.

Variants

Centre crop (fill the frame, lose the sides)

shell
ffmpeg -i input.mp4 -vf "scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920" -c:v libx264 -crf 23 -preset medium -c:a copy vertical.mp4

Scales until the frame is covered, then keeps the middle 1080 px. Two thirds of a 16:9 picture are cut, so the subject must be centred. Output: 1080x1920, 3.8 MB.

Black bars (letterbox)

shell
ffmpeg -i input.mp4 -vf "scale=1080:-2,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:black" -c:v libx264 -crf 23 -preset medium -c:a copy vertical.mp4

The whole picture is kept at 1080x608 and centred on black. Smallest file (1.7 MB) and no processing of the empty space; the black area is wasted on screen.

Blurred background with the encoder settings social platforms want

shell
ffmpeg -i input.mp4 -filter_complex "[0:v]split[bg][fg];[bg]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=20:10[bgb];[fg]scale=1080:-2[fgs];[bgb][fgs]overlay=(W-w)/2:(H-h)/2,format=yuv420p" -c:v libx264 -profile:v high -level 4.1 -crf 23 -preset medium -r 30 -g 60 -c:a aac -b:a 128k -movflags +faststart reel.mp4

Same picture, plus H.264 High profile level 4.1, constant 30 fps, a keyframe every 2 s, AAC audio and faststart so the upload starts playing before it is fully downloaded. ffprobe confirmed High, level 41, yuv420p.

Pitfalls we hit

  • Centre crop is the wrong default for anything that is not a centred talking head: side-by-side interviews, screen recordings and wide shots lose their content.
  • force_original_aspect_ratio=increase followed by crop can leave an odd dimension on unusual sources; the final crop=1080:1920 fixes the size, but check the scale output when you change the target.
  • boxblur on a 1080x1920 background is the slow part of the graph. On long files reduce the passes (boxblur=20:3) or blur a downscaled copy and scale it back up.
  • Uploading a variable frame rate screen recording without -r 30 can produce audio drift on some platforms; force the rate when the source is VFR.

How we verified it

Run with FFmpeg 9.0.1 on 26 August 2026 against a 12 s, 1920x1080, 30 fps H.264/AAC file (9,862,251 bytes). Blurred background: 1080x1920, 360 frames, 2,245,856 bytes. Centre crop: 1080x1920, 3,785,190 bytes. Black pad: 1080x1920, 1,652,728 bytes. Social variant: 1080x1920, profile High, level 41, yuv420p, 2,333,016 bytes.

The same edit as a typed operation

convert_video_to_vertical takes one option, the background (blur or a colour), and renders the 1080x1920 result with the split, blur and overlay graph in a single pass. format_video_for_platform adds the encoder constraints per platform so the caller does not track them.

MCP tool: convert_video_to_verticalPOST /api/v1/tools/video-to-vertical
request body
{
  "inputs": [{ "id": "main", "url": "https://example.com/video.mp4" }],
  "options": { "background": "blur" }
}

FAQ

How do I convert a 16:9 video to 9:16 without cutting anything?

Keep the full picture and fill the rest: either pad with black (scale=1080:-2 then pad=1080:1920) or overlay the sharp video on a blurred, scaled-up copy of itself, which is the primary command on this page.

What resolution should a vertical video be?

1080x1920 is the safe target for Instagram Reels, TikTok and YouTube Shorts. All three commands here output exactly that size; scale the numbers for 720x1280 if bandwidth matters more than sharpness.

Why does my vertical video look pixelated?

The source was cropped and then upscaled. A 1080p source cropped to its centre 608 px and scaled to 1080 wide loses detail. Prefer the blurred or padded layout, or start from a 4K source if you must crop.

Do I need the High profile and faststart flags?

Not for the picture, but the platforms list them: High@4.1, constant frame rate and a keyframe interval of 2 s avoid a server-side re-encode, and faststart lets playback begin before the upload is complete.

Related commands

All FFmpeg commands