How to Add a Blurred Background to Vertical Video (9:16 Fill) with FFmpeg

The problem with landscape footage in a vertical feed
You have 16:9 footage and a Reels, Shorts, or TikTok slot that wants 9:16. Drop the clip in as-is and you get thick black bars top and bottom. The fix that looks intentional instead of lazy is a blurred fill: the same frame, scaled up and blurred, sits behind the sharp video and fills the empty space. FFmpeg does this in one filter_complex, and you can batch it across a whole content library once the recipe is right.
The blurred-fill recipe in one filter_complex
The technique is four steps chained together: split the input into two copies, scale one to fill the 9:16 canvas, blur it, then overlay the untouched clip on top, centered.
Here is the full command targeting a standard 1080x1920 output:
ffmpeg -i input.mp4 -filter_complex \
"[0:v]split=2[bg][fg]; \
[bg]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,gblur=sigma=20[bg]; \
[fg]scale=1080:-2[fg]; \
[bg][fg]overlay=(W-w)/2:(H-h)/2,setsar=1" \
-c:a copy output.mp4
Walk through what each stage does:
split=2[bg][fg]duplicates the source stream so you can process the background and foreground independently from one input.scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920grows the background to cover the full vertical frame without stretching, then crops the overflow. This is what stops the blur from looking squished.gblur=sigma=20is the Gaussian blur.sigmacontrols strength; 20 is a good starting point for 1080-wide output. Lower it toward 10 for a subtle look, raise it toward 30 for a heavy wash.scale=1080:-2on the foreground fits the sharp clip to the 1080 width and lets FFmpeg compute the height.-2keeps that height even, which the H.264 encoder requires.overlay=(W-w)/2:(H-h)/2centers the foreground on the background both horizontally and vertically.
The result is a full 9:16 frame with your original clip crisp in the middle and a soft, motion-matched blur behind it.
Swapping gblur for boxblur
gblur gives the smoothest result, but boxblur is faster and available on older FFmpeg builds. Swap the background stage like this:
[bg]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=luma_radius=20:luma_power=2[bg]
boxblur averages pixels in a box rather than a bell curve, so at the same radius it looks slightly blockier. On short social clips nobody notices, and it shaves processing time on long batches. We break down the parameters in the boxblur filter guide if you want to tune luma_power and the chroma radii.
Common pitfalls with 9:16 blurred fill
This effect breaks in a handful of predictable ways. Here is what actually goes wrong.
Odd dimensions crash the encoder. If you write scale=1080:-1 and the source aspect produces an odd height, libx264 with yuv420p fails with a "height not divisible by 2" error. Always use -2 for the auto-computed dimension.
Stretched background. Skipping force_original_aspect_ratio=increase and just writing scale=1080:1920 distorts the blur into a warped mess. The blur hides a lot, but not that. Keep the scale-then-crop pair.
Aspect ratio flags carry over. Some source files set a non-square sample aspect ratio (SAR). Without setsar=1 at the end, players can render the output stretched even though the pixels are correct. ffprobe will show you the SAR before you process. Our ffprobe metadata guide covers reading it.
Blur too weak. At sigma=5 you can still read the background content, which defeats the point and draws the eye away from the subject. Push sigma to at least 15 on 1080-wide output.
If you only want clean bars with no blur, that is a different tool. See the pad filter for letterbox and pillarbox instead.
Doing it at scale: the one-call API
The command above works great for one file on your laptop. The trouble starts when you are repurposing dozens of clips a week inside an n8n or Make workflow, and every one needs FFmpeg installed, a machine to run it, and enough disk and time to chew through 1080p video without timing out.
FFmpeg Micro runs the same filter graph as a hosted job, so there is nothing to install and no server to babysit. You submit the job, then poll or get a webhook, then download the output.
curl -X POST https://api.ffmpeg-micro.com/jobs \
-H "Authorization: Bearer $FFMPEG_MICRO_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "https://example.com/landscape.mp4",
"filter_complex": "[0:v]split=2[bg][fg];[bg]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,gblur=sigma=20[bg];[fg]scale=1080:-2[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2,setsar=1",
"output": { "format": "mp4" }
}'
The filter string is identical to the local version, so anything you prototype on the command line moves straight to the API. It works the same from code, from n8n, Make, and Zapier, or from an AI agent over MCP. Check the current request format in the docs before wiring it into a pipeline.
Manual FFmpeg vs the hosted API
| Local FFmpeg | FFmpeg Micro | |
|---|---|---|
| Setup | Install binary, match versions | One API call, no install |
| Scaling to 50 clips | Your CPU, your queue | Handled server-side |
| Long jobs | Risk of timeouts on your box | Poll or webhook, no babysitting |
| Where it runs | Your machine only | Code, n8n/Make/Zapier, AI agents |
FAQ
What sigma value should I use for the blur?
For 1080-wide output, start at gblur=sigma=20. Go lower (10 to 15) for a subtle backdrop, higher (25 to 30) for a heavy wash that fully obscures the source frame. Scale the value up if you are working at 4K.
Does the blurred background hurt file size or encoding time?
Blurred regions compress well because they have little high-frequency detail, so the output rarely grows much. The gblur filter itself adds processing time; boxblur is the faster option if you are running large batches.
Can I use a different background instead of the blurred clip?
Yes. Replace the [bg] chain with a separate input (a solid color, a gradient, or a static image) and overlay the scaled foreground on it. The blurred version of the source is the most common look for Reels and Shorts because it matches the clip's own colors and motion.
Prototype your filter string on the playground to dial in the sigma and framing, then sign up free to run it across your whole clip library on the free tier.
About Javid Jamae
Founder & CEO at FFmpeg Micro
Javid is a software engineer, author, and entrepreneur with over 25 years of professional software development experience across enterprise, startup, and consulting environments. He founded FFmpeg Micro to make video processing accessible to developers through a simple, automation-first REST API.
You might also like

Supabase Edge Functions Can't Run FFmpeg: Offload It to a Video API
Supabase Edge Functions can't spawn FFmpeg and ffmpeg.wasm OOMs in the isolate. Offload encoding to a video API and save the result to Storage.

FFmpeg -map Flag Explained: Stream Selection, Multi-Track Audio, and Output Mapping
Learn how the FFmpeg -map flag works for stream selection, multi-track audio extraction, and output mapping with practical CLI and API examples.

How to Use FFmpeg with Next.js (No Binary Required)
Use FFmpeg Micro cloud API to process video in Next.js Route Handlers and Server Actions. No binary installation, no serverless timeouts.
Ready to process videos at scale?
Start using FFmpeg Micro's simple API today. No infrastructure required.
Get Started Free