How to Use FFmpeg hqdn3d Filter for Denoising

This article provides a practical guide on how to use the hqdn3d (High-Quality 3D) filter in FFmpeg to reduce video noise. You will learn how this spatial-temporal denoiser works, understand its syntax and parameters, and see real-world command-line examples ranging from subtle noise reduction to aggressive filtering.

What is the hqdn3d Filter?

The hqdn3d filter is a highly efficient 3D denoiser built into FFmpeg. The “3D” aspect refers to its ability to perform both spatial denoising (reducing noise within a single frame) and temporal denoising (reducing noise by comparing consecutive frames over time). By combining these two methods, hqdn3d effectively smooths out grain and compression artifacts while preserving motion and image details better than 2D-only filters.

Parameter Syntax

The filter accepts up to four optional parameters, separated by colons:

hqdn3d=luma_spatial:chroma_spatial:luma_tmp:chroma_tmp

Practical FFmpeg Examples

To apply the filter, you must pass it to FFmpeg’s video filter flag (-vf).

1. Default Denoising

If you do not specify any parameters, FFmpeg will apply the default values, which offer a balanced, moderate level of noise reduction.

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

2. Mild Denoising (Preserving Detail)

For high-quality source videos with only a light amount of camera hiss or sensor noise, use lower values to prevent losing fine textures.

ffmpeg -i input.mp4 -vf hqdn3d=2.0:1.5:3.0:2.5 output.mp4

3. Heavy Denoising (For Low-Light or VHS Rips)

If you are dealing with very noisy footage, such as analog tape captures or low-light digital video, increase the parameters. Note that this may introduce slight motion blur or “ghosting” in fast-moving scenes.

ffmpeg -i input.mp4 -vf hqdn3d=8.0:6.0:12.0:9.0 output.mp4

4. Denoising Chroma (Color) Only

Sometimes, a video has clean luminance but suffers from heavy color blotches (chroma noise). You can target only the chroma channels by setting the luma parameters to 0.

ffmpeg -i input.mp4 -vf hqdn3d=0:4.0:0:6.0 output.mp4

Tips for Best Results