How to Use FFmpeg Vignette Filter for Dark Borders
This article provides a quick, practical guide on how to use the
FFmpeg vignette filter to add a classic dark border effect
to your videos. You will learn the basic command syntax, how to adjust
key parameters like lens angle and aspect ratio to customize the
vignette’s intensity, and view ready-to-use command examples.
The vignette filter in FFmpeg diminishes the brightness at the periphery of the image compared to the center, creating a classic cinematic or vintage dark border.
Basic Vignette Command
To apply the default vignette effect to a video, use the following basic command:
ffmpeg -i input.mp4 -vf "vignette" output.mp4This applies a standard, subtle dark border centered in the middle of the frame.
Customizing the Vignette Effect
You can customize the vignette by passing specific parameters to the
filter. The syntax for passing parameters is
vignette=parameter1=value1:parameter2=value2.
Here are the primary parameters you can adjust:
angle(ora): Sets the lens angle in radians. This controls the size and sharpness of the dark border. The default value isPI/5(approximately 0.62). Lower values make the dark border larger and closer to the center, while higher values push the border outward.x0andy0: Sets the center coordinates of the vignette. By default, these are set to the center of the frame (w/2andh/2).aspect: Sets the aspect ratio of the vignette. The default is1/1(a circular vignette). You can match your video’s aspect ratio (e.g.,16/9) to create an oval vignette.dither: Reduces banding artifacts in the dark gradient. Set to1(default) to enable dithering, or0to disable it.
Practical Examples
1. Creating a Stronger, More Dramatic Dark Border
To decrease the bright area and make the dark vignette border much
more prominent, decrease the angle value (for example, to
0.3 or PI/10):
ffmpeg -i input.mp4 -vf "vignette=angle=0.3" output.mp42. Creating a Subtle, Soft Edge Border
To push the dark border further to the edges for a more subtle
effect, increase the angle value (for example, to
0.8 or PI/3):
ffmpeg -i input.mp4 -vf "vignette=angle=0.8" output.mp43. Matching the Video Aspect Ratio
By default, the vignette shape is circular. To stretch the vignette
into an oval that matches a standard widescreen (16:9) frame, adjust the
aspect parameter:
ffmpeg -i input.mp4 -vf "vignette=aspect=16/9" output.mp44. Combining Parameters
You can combine multiple parameters to fine-tune the output. The following command creates a strong, widescreen-matched vignette:
ffmpeg -i input.mp4 -vf "vignette=angle=0.4:aspect=16/9" output.mp4