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.
radiusorr(default:3): Sets the window radius for the blur. A larger radius increases the blur area but requires more processing power. The valid range is 1 to 30.planesorp(default:1): Specifies which color planes to filter. It uses a bitmask where Y=1, U=2, V=4, and Alpha=8.1: Filter only the luma (brightness) channel (default).7: Filter luma and both chroma (color) channels.15: Filter all channels including alpha.
sigmaors(default:128): Controls the blur strength. A higher sigma value results in more intense blurring of similar pixels. The valid range is 1 to 4096.mthresholdorm(default:0): Sets the minimum edge preservation threshold. Higher values prevent the filter from blurring pixels unless they are part of a very strong edge. The valid range is 0 to 100.
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.mp42. 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.mp43. 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