Noise is unpredictable information, so it eats a lot of bits. hqdn3d for light removal, nlmeans for heavy removal, and why "the more you remove, the better" isn't true.
In Chapter 3 you learned that an encoder saves bits by reducing redundancy through prediction, then transforming and quantizing the remaining difference (the residual) (Inter prediction, Quantization). Camera sensor noise and film grain differ randomly from frame to frame, so they are almost impossible to predict. That is why, for the same quality target, a noisy video tends to make the encoder spend more bits. This leads to the question: "if I reduce noise before encoding, will the file get smaller?"
hqdn3d is a fast filter that reduces noise both spatially (within a frame) and temporally (across neighboring frames). Its parameters are in the order luma_spatial:chroma_spatial:luma_tmp:chroma_tmp, and the defaults in the FFmpeg documentation are 4.0 : 3.0 : 6.0 : 4.5. Bigger numbers remove more strongly.
# With defaults
ffmpeg -i noisy.mp4 -vf "hqdn3d" -c:v libx264 -crf 22 -c:a copy out.mp4
# Lighter: luma spatial 2, chroma spatial 1.5, luma temporal 3, chroma temporal 3
ffmpeg -i noisy.mp4 -vf "hqdn3d=2:1.5:3:3" -c:v libx264 -crf 22 -c:a copy out_light.mp4nlmeans (Non-Local Means) finds pieces with similar texture (patches) within the frame and averages them. It is generally said to be much slower than hqdn3d but better at preserving detail. Strength is set with the s option, and the larger the patch size p and search range r, the slower it gets. Check the defaults with ffmpeg -h filter=nlmeans. Before using it on a long video, it's a good idea to time it on a short section first.
ffmpeg -ss 30 -t 10 -i noisy.mp4 -vf "nlmeans=s=3" -c:v libx264 -crf 22 -an test_nlmeans.mp4The performance and quality comparison reflects generally known tendencies. These are not figures measured on this site.
AV1 has film grain synthesis in its specification. The encoder analyzes the grain and stores it as parameters, and the decoder recreates and applies the grain at playback. SVT-AV1 also offers a related option (film-grain). Instead of preserving the grain as bits, it is removed and synthesized, which is used for content where grain matters; the effect varies a lot with the source and settings, and you also need to check decoder support. x264 has -tune grain, which tunes toward preserving grain.
(1) First check whether the noise in the source is noticeable. (2) Render a 10-second section at a light strength (hqdn3d, light) with the same CRF and look at both the file size and the picture. (3) Use it only if the file size drops meaningfully and there is no visible loss. You can see the general relationship between CRF, file size, and VMAF in the CRF sweep experiment, but that experiment did not cover denoising, so it doesn't directly tell you the effect of denoising.
A fast filter that reduces noise both spatially and temporally. Parameters are luma_spatial:chroma_spatial:luma_tmp:chroma_tmp.
A denoising filter that finds similar patches and averages them. Refined but slow.
A method where grain is removed and only parameters are stored, and the decoder recreates and applies the grain at playback. Part of the AV1 specification.
The difference between the predicted and actual values. Noise can't be predicted, so the residual grows and eats a lot of bits.
You compared a denoised video with the original using VMAF and the score came out low. What is the most appropriate interpretation?
Why does a noisy video tend to use more bits at the same target quality?