How to Use FFmpeg yaepblur for Edge Preserving Blur

This guide explains how to use the yaepblur (Yet Another Edge Preserving Blur) filter in FFmpeg to smooth out image noise while keeping sharp edges intact. You will learn the basic command syntax, understand the key parameters like radius and sigma, and see practical examples of how to apply this filter to your video processing workflows.

Understanding the yaepblur Filter

The yaepblur filter is an edge-preserving smoothing filter. Unlike a standard box or Gaussian blur that blurs everything uniformly, yaepblur blurs low-contrast details (like film grain or sensor noise) while preserving high-contrast boundaries (like text, object outlines, and sharp details).

This makes it highly effective for video denoising, cartoon/anime preprocessing, and compression optimization.

Key Parameters

The yaepblur filter accepts several parameters to control the blur strength and edge detection sensitivity. You can specify them in the format yaepblur=parameter1=value1:parameter2=value2.

Practical Examples

1. Basic Edge-Preserving Blur

To apply the filter using its default settings (which filters only the luma channel with a radius of 3 and a sigma of 128), use the following command:

ffmpeg -i input.mp4 -vf yaepblur output.mp4

2. Strong Denoising on All Color Channels

If you want to apply a stronger blur to clean up a noisy color video, you should increase the radius, raise the sigma value, and enable filtering on all YUV channels (planes=7):

ffmpeg -i input.mp4 -vf yaepblur=r=5:s=256:p=7 output.mp4

3. Fine-Tuning with Edge Preservation Threshold

To aggressively blur flat areas while ensuring that even moderate edges are strictly preserved, increase the mthreshold parameter:

ffmpeg -i input.mp4 -vf yaepblur=r=4:s=300:m=10:p=7 output.mp4