FFmpeg Horizontal Blur Using gblur Filter
This article provides a quick guide on how to use FFmpeg’s
gblur (Gaussian blur) filter to apply blur strictly in the
horizontal direction while leaving the vertical direction sharp. You
will learn the exact command-line syntax, the key parameters to adjust,
and a practical example of the command in action.
The gblur Filter Syntax
The gblur filter in FFmpeg allows you to control
horizontal and vertical blur independently using two primary
parameters:
sigma: Controls the horizontal blur strength (standard deviation of the Gaussian formula).sigmaV: Controls the vertical blur strength.
By default, if you only set sigma, FFmpeg will apply the
same value to sigmaV, blurring both directions equally. To
blur only horizontally, you must explicitly set
sigmaV to 0.
The Command
To apply a horizontal-only blur, use the following FFmpeg command structure:
ffmpeg -i input.mp4 -vf "gblur=sigma=20:sigmaV=0" output.mp4Parameter Breakdown
-i input.mp4: Specifies your input video file.-vf: Flags the start of the video filter graph.gblur: Calls the Gaussian blur filter.sigma=20: Sets the horizontal blur radius. Increase this number for a stronger horizontal blur, or decrease it for a subtler effect.sigmaV=0: Disables vertical blurring entirely, keeping the vertical lines sharp.output.mp4: The resulting blurred video file.
Optional: Adjusting Filter Steps
If you want a smoother or higher-quality blur, you can add the
steps parameter. The steps parameter defines
how many times the blur filter is applied per frame (default is 1):
ffmpeg -i input.mp4 -vf "gblur=sigma=20:steps=3:sigmaV=0" output.mp4Using steps=3 produces a higher quality Gaussian
approximation, though it requires slightly more processing power.