Configure FFmpeg libx264 Noise Reduction

This article provides a quick guide on how to configure the noise-reduction parameter in the libx264 encoder using FFmpeg. You will learn the correct syntax, the range of values to use, and how this parameter helps optimize your video encoding process by reducing noise and improving compression.

Understanding the libx264 Noise Reduction Parameter

The libx264 encoder has a built-in noise reduction filter controlled by the nr parameter. This parameter performs a fast, low-overhead noise reduction directly inside the encoder before motion estimation. Because it is integrated into the encoder, it is much faster than using external FFmpeg video filters (like hqdn3d or owdenoise), though it is generally less sophisticated.

How to Apply the Parameter in FFmpeg

To use the noise reduction parameter in FFmpeg, you must pass it through the -x264-params option.

The basic syntax is:

ffmpeg -i input.mp4 -c:v libx264 -x264-params nr=VALUE -c:a copy output.mp4

Alternatively, you can use the older -x264opts syntax:

ffmpeg -i input.mp4 -c:v libx264 -x264opts nr=VALUE -c:a copy output.mp4

The nr parameter accepts an integer value:

While the technical limit is very high, practical values for real-world video encoding usually fall between 100 and 1000.

Example Command

To encode a video with a moderate level of noise reduction (value of 500), use the following command:

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -x264-params nr=500 output.mp4

Combining with Other x264 Parameters

If you are already using -x264-params for other settings (like keyframe intervals or tuning), you can append the nr parameter by separating the options with a colon (:):

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -x264-params keyint=240:nr=400 output.mp4