FFmpeg Blurred Background with Scrolling Text

This guide explains how to create a blurred background from a source video and overlay both the original footage and an animated scrolling text box using FFmpeg. By combining the split, boxblur, overlay, and drawtext filters into a single complex filtergraph, you can produce a modern, polished video layout suitable for social media, vertical-to-horizontal conversion, or broadcast tickers.

The Complete Command

Run the following command in your terminal to generate the composite video:

ffmpeg -i input.mp4 -filter_complex \
"[0:v]split=2[bg_in][fg_in]; \
 [bg_in]scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080,boxblur=luma_radius=25:luma_power=2[bg]; \
 [fg_in]scale=1920:1080:force_original_aspect_ratio=decrease[fg]; \
 [bg][fg]overlay=(W-w)/2:(H-h)/2[composed]; \
 [composed]drawtext=text='Your scrolling text announcement goes here': \
 fontcolor=white:fontsize=32: \
 box=1:boxcolor=black@0.6:boxborderw=15: \
 x=w-mod(t*120\,w+text_w):y=h-text_h-40[outv]" \
-map "[outv]" -map 0:a? -c:v libx264 -c:a copy output.mp4

How the Filtergraph Works

The -filter_complex argument processes video streams in stages:

  1. split=2[bg_in][fg_in]: Duplicates the input video stream [0:v] into two identical paths: one for the blurred background (bg_in) and one for the foreground (fg_in).
  2. scale and crop (Background): Resizes the background stream to fill a standard 1920x1080 canvas without leaving black bars, cropping any overflow.
  3. boxblur=luma_radius=25:luma_power=2: Blurs the scaled background. Increasing luma_radius intensifies the blur strength.
  4. scale (Foreground): Adjusts the main video to fit within the 1920x1080 dimensions while preserving its original aspect ratio.
  5. overlay=(W-w)/2:(H-h)/2: Centers the sharp foreground video over the blurred background layer.
  6. drawtext: Renders the text and box animation:
    • box=1:boxcolor=black@0.6:boxborderw=15: Enables a semi-transparent black rectangular background around the text with 15 pixels of padding.
    • x=w-mod(t*120\,w+text_w): Controls the horizontal scroll speed. t represents the timestamp in seconds, and 120 determines the scroll speed in pixels per second.
    • y=h-text_h-40: Positions the text box 40 pixels above the bottom edge of the frame.

Vertical Scrolling Variation

To change the text movement from a horizontal ticker to a vertical crawl (bottom to top), replace the drawtext coordinates with:

x=(w-text_w)/2:y=h-mod(t*60\,h+text_h)

This centers the text box horizontally while scrolling it upward across the frame at a speed of 60 pixels per second.