How to Disable psy-rd in FFmpeg

This article provides a straightforward guide on how to disable psychovisual rate-distortion (psy-rd) optimization in FFmpeg. You will learn the exact command-line flags needed for both the H.264 (libx264) and H.265 (libx265) encoders to turn off this feature, helping you eliminate unwanted encoding artifacts like ringing or blockiness and achieve a cleaner video output.

Why Disable psy-rd?

Psychovisual rate-distortion (psy-rd) is enabled by default in many FFmpeg encoders to enhance perceived picture sharpness and detail. It does this by allowing some mathematical distortion in areas where human eyes are less likely to notice it. However, at lower bitrates or with specific types of content (like hand-drawn animation, flat vector graphics, or clean gradients), psy-rd can introduce distracting artifacts such as ringing, mosquito noise, or unnatural grain. Disabling it forces the encoder to prioritize mathematical accuracy (high PSNR/SSIM) over psychovisual enhancements.


Disabling psy-rd in H.264 (libx264)

To disable psychovisual optimization in the H.264 encoder, you can use either the -psy flag or the -psy-rd flag.

Method 1: Disable all psychovisual optimizations

The easiest way is to pass -psy 0 in your command. This disables both psy-rd and psy-trellis simultaneously.

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -psy 0 output.mp4

Method 2: Manually set psy-rd and psy-trellis to zero

If you want to be explicit, you can define the strength of both psy-rd and psy-trellis using the format strength:trellis. Setting both values to 0.0 disables them.

ffmpeg -i input.mp4 -c:v libx264 -crf 20 -psy-rd 0.0:0.0 output.mp4

Disabling psy-rd in H.265 (libx265)

For the H.265 encoder, psychovisual settings are controlled via the -x265-params option. You need to disable both psy-rd (psychovisual rate-distortion) and psy-rdoq (psychovisual rate-distortion quantization) to fully turn off the psychovisual features.

Use the following syntax to set both parameters to 0:

ffmpeg -i input.mp4 -c:v libx265 -crf 22 -x265-params psy-rd=0:psy-rdoq=0 output.mp4

Verification

After running the command, you can verify that the options were applied by checking the encoding log printed in your terminal. Look for the configuration summary line (e.g., analyzing: psy=0 for x264 or psy-rd=0.00 / psy-rdoq=0.00 for x265) to confirm that the psychovisual optimizations have been successfully deactivated.