High Efficiency Video Coding (HEVC), or H.265, is a video compression standard that offers improved compression efficiency compared to its predecessor, Advanced Video Coding (AVC), or H.264. One of the features of HEVC is the ability to encode videos with a higher dynamic range, which results in better color accuracy and an overall improved visual experience.
What are Max CLL and Max FLL in HEVC?
In HEVC, Max Content Light Level (Max CLL) and Max Frame Average Light Level (Max FLL) are metadata values that describe the brightness of the video content. Max CLL represents the maximum luminance of any single pixel in the video, while Max FLL represents the maximum frame-averaged luminance. These values are used by the encoder to optimize the encoding process, taking into account the brightness of the video content.
Why modify Max CLL and Max FLL values?
Modifying Max CLL and Max FLL values can be useful in a number of scenarios. For example, if the encoder is set to a conservative default value for Max CLL, it may result in a loss of detail in very bright scenes. By increasing the Max CLL value, you can ensure that the encoder takes into account the higher luminance levels, resulting in a better-quality video. Similarly, if Max FLL is set too high, it can result in unnecessary bitrate being used for average-brightness frames. By lowering Max FLL, you can reduce the bitrate used for these frames, resulting in a more efficient encoding.
How to modify Max CLL and Max FLL values using x265?
The x265 encoder allows you to directly modify the Max CLL and Max FLL values in the HEVC stream. This can be done using the --max-cll and --max-fll options, respectively. Here's an example command that sets Max CLL to 1000 and Max FLL to 50:
x265 --max-cll 1000 --max-fll 50 input.yuv output.hevc
Note that the input file should be in the YUV format, as x265 does not support modifying Max CLL and Max FLL values in other formats. Also, keep in mind that the values you set for Max CLL and Max FLL should be within the valid range, which is typically between 1 and 10000.
Using x265 with ffmpeg
If you prefer to use ffmpeg as your frontend for x265, you can modify Max CLL and Max FLL values using the -x265-params option. Here's an example command that sets Max CLL to 1000 and Max FLL to 50:
ffmpeg -i input.mp4 -c:v libx265 -x265-params max-cll=1000:max-fll=50 output.mp4
Additional considerations
Modifying Max CLL and Max FLL values can have a significant impact on the quality and efficiency of the encoding. It's important to carefully consider the values you set, taking into account the brightness of the video content and the desired trade-off between quality and bitrate. Additionally, keep in mind that modifying these values may require additional processing time, as
Summary:
- Modifying Max CLL and Max FLL values can improve the quality and efficiency of HEVC encoding.
- The x265 encoder allows you to directly modify these values using the `--max-cll` and `--max-fll` options.
- When using ffmpeg as a frontend for x265, you can modify these values using the `-x265-params` option.
- Carefully consider the values you set, taking into account the brightness of the video content and the desired trade-off between quality and bitrate.
References:
-