How to Use FFmpeg Vignette Filter for Dark Borders

The vignette filter in FFmpeg allows you to naturally darken the outer edges of a video frame to draw focus toward the center, mimicking the optical characteristics of classic camera lenses. This guide covers the basic syntax required to apply a standard dark border, how the primary configuration parameters work, and practical command-line examples for adjusting the intensity and spread of the effect.

Basic Vignette Command

To apply a default dark vignette to a video, use the -vf (video filter) flag followed by vignette:

ffmpeg -i input.mp4 -vf "vignette" -c:a copy output.mp4

By default, FFmpeg centers the effect in the middle of the frame and applies a standard lens falloff angle of PI/5 radians, smoothly darkening the corners while leaving the audio stream untouched via -c:a copy.

Controlling Intensity and Spread with the angle Parameter

The primary way to control the size and darkness of the border is through the angle (or a) parameter. The angle represents the internal field-of-view limit of the lens effect.

  • Smaller angles (e.g., PI/8 or PI/6) bring the darkness further into the center of the frame, creating a heavier, more dramatic vignette.
  • Larger angles (e.g., PI/3 or PI/2) push the darkness outward, leaving only a subtle shading in the extreme corners.

To create a strong, dramatic dark border:

ffmpeg -i input.mp4 -vf "vignette=angle=PI/8" -c:a copy output.mp4

To create a subtle, barely noticeable edge darkening:

ffmpeg -i input.mp4 -vf "vignette=angle=PI/3" -c:a copy output.mp4

Adjusting Center Point and Aspect Ratio

By default, the vignette uses the video's center as the focal point. You can shift the center using the x0 and y0 parameters, which accept mathematical expressions based on the frame dimensions w (width) and h (height).

To shift the clear focal area toward the upper-third of the frame:

ffmpeg -i input.mp4 -vf "vignette=x0=w/2:y0=h/3" -c:a copy output.mp4

You can also adjust the shape of the vignette using the aspect parameter. By default, the vignette scales proportionally to match the video's aspect ratio. To force a circular vignette on a widescreen video, set the aspect ratio to 1/1:

ffmpeg -i input.mp4 -vf "vignette=aspect=1/1" -c:a copy output.mp4

Creating an Animated Vignette

FFmpeg allows dynamic evaluation of parameters over time by setting eval=frame. Using the time variable t, you can make the vignette expand or contract dynamically.

To create a breathing or pulsing dark border:

ffmpeg -i input.mp4 -vf "vignette=angle='PI/5+0.1*sin(2*PI*t)':eval=frame" -c:a copy output.mp4