How to Adjust qcomp in FFmpeg

This article explains how to use and adjust the quantizer curve compression parameter (-qcomp) in FFmpeg. You will learn what this parameter does, how it affects your video quality and file size, and the exact commands needed to customize it for your video encoding projects.

What is -qcomp?

The -qcomp option in FFmpeg stands for "quantizer curve compression." It is primarily used with the libx264 and libx265 encoders to control how bitrate is distributed between high-complexity (high-motion) scenes and low-complexity (static) scenes.

The parameter accepts a float value between 0.0 and 1.0:

  • 0.0 (Constant Bitrate-like): The encoder keeps the bitrate strictly constant. It does not allocate extra data to complex scenes, which can lead to macroblocking or pixelation during fast motion.
  • 1.0 (Constant Quantizer-like): The encoder maintains a constant quality/quantizer. It will dump massive amounts of data into high-motion scenes to keep them perfectly sharp, which can cause massive spikes in file size.
  • 0.60 (Default): This is the default value for x264 and x265. It offers an optimal balance for most standard video content.

How to Adjust -qcomp in the FFmpeg Command

To adjust this parameter, add -qcomp followed by your desired value to your FFmpeg encoding command. It is typically paired with Constant Rate Factor (-crf) encoding.

Example: Standard Encoding with Default qcomp (0.60)

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -qcomp 0.60 output.mp4

Example: Increasing qcomp for High-Action Video (0.75)

If you are encoding sports, gaming, or action movies and notice that fast-moving scenes look blurry, increase the value. This allows the encoder to use more bitrate during high-motion scenes.

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -qcomp 0.75 output.mp4

Example: Decreasing qcomp to Reduce File Size Spikes (0.50)

If you have a limited bandwidth budget and want to prevent sudden bitrate spikes during action scenes, lower the value. This will compress high-motion scenes more heavily to keep the overall file size predictable.

ffmpeg -i input.mp4 -c:v libx264 -crf 23 -qcomp 0.50 output.mp4
  • For general video: Stick to the default 0.60.
  • For animation: A slightly lower value like 0.50 to 0.55 often works well because animated transitions do not require as much bitrate variation as live-action footage.
  • For high-motion/sports: Try a value between 0.70 and 0.80 to keep fast-moving details sharp, provided you do not mind a larger final file size.