Configure FFmpeg Vignette Angle Radius and Center

This guide explains how to customize the vignette filter in FFmpeg by adjusting its angle, outer radius, and center coordinates. You will learn the specific parameters to use, their syntax, and practical command-line examples to achieve the perfect shading effect for your videos.

To configure the vignette filter, you must pass specific arguments to the -vf "vignette=..." filtergraph. The key parameters for controlling the position, size, and intensity of the vignette are x0, y0, angle, and radius.

1. Setting the Center Coordinates (x0 and y0)

By default, the vignette is centered in the middle of the frame. You can shift the focus of the vignette by manually defining the X and Y coordinates of its center using the x0 and y0 options. You can use absolute pixel values or expressions based on the input width (w) and height (h).

2. Configuring the Outer Radius (radius or r)

The radius parameter sets the outer limit of the vignette. This value can be defined in pixels or as a mathematical expression using w (width) and h (height).

3. Adjusting the Angle (angle or a)

The angle parameter controls the falloff rate (the sharpness of the transition from light to dark). It is expressed in radians. A smaller angle creates a sharper, more defined edge, while a larger angle creates a smoother, more gradual fade.

Practical Examples

Example 1: A subtle, wide vignette centered in the frame This command uses a larger angle to make the transition very gradual, while keeping the default center.

ffmpeg -i input.mp4 -vf "vignette=angle=PI/3:radius=w/2" output.mp4

Example 2: A dramatic, off-center spotlight vignette This command moves the vignette center to the upper right quadrant of the screen, narrows the radius, and sharpens the edge with a small angle.

ffmpeg -i input.mp4 -vf "vignette=x0=3*w/4:y0=h/4:radius=w/4:angle=0.3" output.mp4

Example 3: Dynamic vignette (animated center) FFmpeg allows you to use t (time in seconds) to animate parameters. This command moves the vignette center horizontally across the screen over time.

ffmpeg -i input.mp4 -vf "vignette=x0='w/2+sin(t)*100':y0=h/2" output.mp4