MainConcept VVC/H.266 Encoder Plug-in for FFmpeg 3.2.0
VVC/H.266 Encoder plug-in usage

The following briefly describes how to use the MainConcept VVC/H.266 Encoder plug-in for FFmpeg.

The command line format should follow the structure below, depending on which operating system you are using.

Note
This plug-in is not supported on Linux ARM.

On Windows

ffmpeg <ffmpeg-params> \
-c:v omx_enc_vvc \
-omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video \
-omx_param "<mc-general-params>" \
[VVC Settings] "<mc-codec-params>" \
<ffmpeg-output-parameters>

The following is a sample command line:

ffmpeg -s 768x432 -r 27 -pix_fmt yuv420p -i Tears_Of_Steel_768x432_24_I420_1440_frames.yuv -t 10 -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -minrate 1M -maxrate 5M -omx_param "[VVC Settings]profile=0: bit_depth_luma=10:bit_depth_chroma=10:[VVC Layer 0000]:bit_rate=500000" output.vvc -y

The following is a command line using a configuration file:

ffmpeg -s 768x432 -pix_fmt yuv420p -i Tears_Of_Steel_768x432_24_I420_1440_frames.yuv -t 10 -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -minrate 1M -maxrate 5M -omx_param "cfg_file_path=sample_enc_vvc.ini" output.vvc -y

On Linux

Note
The command line examples below are Windows specific. To run examples on Linux, you must slightly modify them. Instead of -omx_core omxil_core.dll, you need to specify -omx_core libomxil_core.so on Linux.

ffmpeg <ffmpeg-params> \
-c:v omx_enc_vvc \
-omx_core libomxil_core.so -omx_name OMX.MainConcept.enc_vvc.video \
-omx_param "<mc-general-params>" \
[VVC Settings] "<mc-codec-params>" \
<ffmpeg-output-parameters>

The following is a sample command line:

ffmpeg -s 768x432 -r 27 -pix_fmt yuv420p -i Tears_Of_Steel_768x432_24_I420_1440_frames.yuv -t 10 -c:v omx_enc_vvc -omx_core libomxil_core.so -omx_name OMX.MainConcept.enc_vvc.video -minrate 1M -maxrate 5M -omx_param "[VVC Settings]profile=0:bit_depth_luma=10:bit_depth_chroma=10:[VVC Layer 0000]:bit_rate=500000" output.vvc -y

The following is sample command line for a configuration file:

ffmpeg -s 768x432 -pix_fmt yuv420p -i Tears_Of_Steel_768x432_24_I420_1440_frames.yuv -t 10 -c:v omx_enc_vvc -omx_core libomxil_core.so -omx_name OMX.MainConcept.enc_vvc.video -minrate 1M -maxrate 5M -omx_param "cfg_file_path=sample_enc_vvc.ini" output.vvc -y

FFmpeg options mapped to the MainConcept VVC/H.266 Encoder

The following FFmpeg options are mapped from the command-line to the MainConcept VVC/H.266 Video Encoder:

FFmpeg option Usage example
bit_rate -b:v 1M -b:a 192k
pix_fmt -pix_fmt yuv420p
gop_size -g 4
max_b_frames -bf 2
framerate -r 30
width; height -s 720x480

omx_param parameters (mc-general-params)

All settings below are optional parameters for omx_param parameters (mc-general-params):

Function Description
cfg_file_path Specifies path to the VVC/H.266 encoder configuration file containing all parameters for encoding:
-omx_param "cfg_file_path=vvc_config.ini"
perf_level Specifies the predefined performance level 1 to 31 for encoding. Default is 15. Predefined values are also allowed:
  • "fastest" = 1
  • "faster" = 8
  • "balanced" = 15
  • "better_quality" = 25
  • "best_quality" = 30
[VVC Settings]
[VVC Layer 0000]
Specifies parameters from the VVC/H.266 encoder configuration on the command line, which can be applied under [VVC Settings] and [VVC Layer 0000]. Use : as a separator and = as a value set for the key. They must have the same structure and order as they would appear in an *.ini file, e.g.
-omx_param "preset=main10:[VVC Settings]:[VVC Layer 0000]:bit_rate=100000"

These arguments match the MainConcept VVC/H.266 encoder settings. See Parameters under [VVC Settings] and [VVC Layer 0000] for more details or a VVC encoder configuration file as an example.

Force key frame settings

This plug-in offers an option to force the current frame to become an IDR frame with FFmpeg. This option is essential for adaptive bitrate streaming formats to create segments that only occur at key frames. This will provide smooth and proper playback of the segments.You can use FFmpeg's generic force_key_frames parameter to specify when a new IDR frame should be set. However, you also need to define some MainConcept Encoder parameters via -omx_param. So if -force_key_frames 'expr:gte(t,n_forced*N)' is present (N is the number of seconds) then you should disable fixed_intra_position (by setting it to 0), which means irregular IRAP (Intra Random Access Pictures ) placement.There are currently two typical use cases to set force_key_frames in FFmpeg:

  1. ...-force_key_frames 'expr:gte(t,n_forced*N) ... -omx_param "... :fixed_intra_position=0:vscd_mode= 0:..."
    IDR-frames are only at every framerate*N position.
  2. ...-force_key_frames 'expr:gte(t,n_forced*N) ... -omx_param "... :fixed_intra_position=0:..."
    IDR-frames are at every framerate*N position plus I-frames (CRA) at scene cuts.

Command line examples

Note
The command line examples below are Windows specific. To run examples on Linux, you must slightly modify them. Instead of -omx_core omxil_core.dll, you need to specify -omx_core libomxil_core.so on Linux.

ffmpeg -s 768x432 -pix_fmt yuv420p -i Tears_Of_Steel_768x432_24_I420_1440_frames.yuv -t 10 -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -minrate 1M -maxrate 5M -omx_param "cfg_file_path=config.cfg" output.vvc -y 
ffmpeg -s 768x432 -r 27 -pix_fmt yuv420p -i Tears_Of_Steel_768x432_24_I420_1440_frames.yuv -t 10 -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -minrate 1M -maxrate 5M -omx_param "[VVC Settings]profile=0:bit_depth_luma=10:bit_depth_chroma=10:[VVC Layer 0000]:bit_rate=500000" output.vvc -y 
ffmpeg -s 768x432 -r 27 -pix_fmt yuv420p -i Tears_Of_Steel_768x432_24_I420_1440_frames.yuv -t 10 -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -minrate 1M -maxrate 5M -omx_param "[VVC Settings]profile=0:bit_depth_luma=10:bit_depth_chroma=10:[VVC Layer 0000]:bit_rate=500000: write_vps=1:deblocking_filter=1" output.vvc -y 
ffmpeg -y -i sample.mxf -an -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -omx_param "preset=main10:perf_level=15" output.vvc 
ffmpeg -c omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -omx_param_dec "skip=0:loop_filter=1:smp_mode=0:osd=0:low_latency=0:mv_precision=0:deinterlacing_flag=0" -i source.h264 output.yuv -y 
ffmpeg -s 768x432 -t 10 -r 2 -i Tears_Of_Steel_1280x720_24_I420_1440_frames.yuv -force_key_frames "expr:gte(t,n_forced*3)" -c:a copy -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video output.vvc -y 
ffmpeg -s 768x432 -i Tears_Of_Steel_1280x720_24_I420_1440_frames.yuv -force_key_frames "expr:gte(t,n_forced*2)" -c:a copy -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video output.vvc -y
ffmpeg -s 768x432 -i Tears_Of_Steel_1280x720_24_I420_1440_frames.yuv -c:a copy -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -omx_param "[VVC Settings]:max_intra_period=40:min_intra_period=40" output.vvc -y 
ffmpeg -s 768x432 -t 10 -r 2 -i Tears_Of_Steel_1280x720_24_I420_1440_frames.yuv -c:a copy -c:v omx_enc_vvc -omx_core omxil_core.dll -omx_name OMX.MainConcept.enc_vvc.video -omx_param "[VVC Settings]:max_intra_period=2" output.vvc -y 

VVC/H.266 multiplexing

FFmpeg does not yet support VVC/H.266 multiplexing (e.g. into MP4), so this process must be carried out in a separate post-processing step.

Currently, multiplexing to MP4 file format is supported by the MP4Box packager that comes with the GPAC open source multimedia framework. You can download and install it from the GPAC website. Once installed, you can run MP4Box from the command-line to multiplex your VVC video and audio Elementary Streams to MP4 like this:

mp4box -add 20_2_16ch_ffmpeg_output.aac+Germany_vs_Brazil_2014_hdr.vvc "Semi_Final_2014_hdr.mp4"

Parameters

The MainConcept VVC/H.266 Encoder plug-in for FFmpeg comes with a sample configuration (*.ini) file that covers the following encoder settings and parameters. You can modify them manually in a normal text editor and pass them to FFmpeg via

-omx_param "cfg_file_path=<...>"
Note
This is just an example; you should only use the parameters that you actually need and remove the ones that are not required.

[VVC Settings]

VVC settings are covered under the following:

General parameters

profile

VVC/H.266 Profile used to encode
  • 0: VVC Main 10 profile

chroma_format

Chroma format of the encoded picture.
  • 1: 4:2:0

max_dec_pic_buffering

Maximum number of pictures in decoded picture buffer. This is restricted by level ID. Value range is [1, 16].

bit_depth_luma

Bit depth of the encoded luminance samples. Note that bit_depth_luma and bit_depth_chroma need to be set to the same value.
  • 8: 8-bit
  • 10: 10-bit

bit_depth_chroma

Bit depth of the encoded chrominance samples. Note that bit_depth_chroma and bit_depth_luma need to be set to the same value.
  • 8: 8-bit
  • 10: 10-bit

time_scale

Timing info that is used together with num_units_in_tick (frame rate in fps = time_scale / num_units_in_tick). The time_scale parameter denotes the number of time units that pass in one second. By default, time_scale is set to 27000000 (27 MHz clock). These two values are used for calculating the exact frame rate of an encoded stream, where fps = time_scale / num_units_in_tick.

num_units_in_tick

Number of time units of a clock operating at the frequency time_scale Hz that corresponds to one clock tick. Use together with time_scale (frame_rate = time_scale / num_units_in_tick) to calculate exact frame rate of a stream.

Video signal description

input_colorimetry.color_primaries

Specifies the chrominance coordinates of the source primaries.
  • -1: COLOR_PRIMARIES_AUTO
  • 1: COLOR_PRIMARIES_BT709_6
  • 2: COLOR_PRIMARIES_UNSPECIFIED
  • 4: COLOR_PRIMARIES_BT470_6_SYSTEM_M
  • 5: COLOR_PRIMARIES_BT470_6_SYSTEM_B_G
  • 6: COLOR_PRIMARIES_SMPTE_170M
  • 7: COLOR_PRIMARIES_SMPTE_240M
  • 8: COLOR_PRIMARIES_GENERIC_FILM
  • 9: COLOR_PRIMARIES_BT2020
  • 10: COLOR_PRIMARIES_SMPTE_ST_428_1
  • 11: COLOR_PRIMARIES_SMPTE_RP_431_2
  • 12: COLOR_PRIMARIES_SMPTE_EG_432_1
  • 22: COLOR_PRIMARIES_EBU_TECH_3213_E
  • 256: COLOR_PRIMARIES_CUSTOM

input_colorimetry.transfer_characteristics:

Specifies the gamma correction function of the source.
  • -1: TRANSFER_CHARACTERISTICS_AUTO
  • 1: TRANSFER_CHARACTERISTICS_BT709_6
  • 2: TRANSFER_CHARACTERISTICS_UNSPECIFIED
  • 4: TRANSFER_CHARACTERISTICS_BT470_6_SYSTEM_M
  • 5: TRANSFER_CHARACTERISTICS_BT470_6_SYSTEM_B_G
  • 6: TRANSFER_CHARACTERISTICS_BT601_6
  • 7: TRANSFER_CHARACTERISTICS_SMPTE_240M
  • 8: TRANSFER_CHARACTERISTICS_LINEAR
  • 9: TRANSFER_CHARACTERISTICS_LOGARITHMIC_1
  • 10: TRANSFER_CHARACTERISTICS_LOGARITHMIC_2
  • 11: TRANSFER_CHARACTERISTICS_IEC_61966_2_4
  • 12: TRANSFER_CHARACTERISTICS_BT_1361_0
  • 13: TRANSFER_CHARACTERISTICS_IEC_61966_2_1
  • 14: TRANSFER_CHARACTERISTICS_BT2020_10BIT
  • 15: TRANSFER_CHARACTERISTICS_BT2020_12BIT
  • 16: TRANSFER_CHARACTERISTICS_SMPTE_ST_2084
  • 17: TRANSFER_CHARACTERISTICS_SMPTE_ST_428_1
  • 18: TRANSFER_CHARACTERISTICS_BT2100_HLG
  • 256: TRANSFER_CHARACTERISTICS_CUSTOM

input_colorimetry.matrix_coefficients

Defines the source's coefficients for getting YUV to RGB or inverse conversion.
  • -1: MATRIX_COEFFICIENTS_AUTO
  • 0: MATRIX_COEFFICIENTS_IDENTITY
  • 1: MATRIX_COEFFICIENTS_BT709_6
  • 2: MATRIX_COEFFICIENTS_UNSPECIFIED
  • 4: MATRIX_COEFFICIENTS_FCC
  • 5: MATRIX_COEFFICIENTS_BT470_6_SYSTEM_B_G
  • 6: MATRIX_COEFFICIENTS_BT601_6
  • 7: MATRIX_COEFFICIENTS_SMPTE_240M
  • 8: MATRIX_COEFFICIENTS_YCGCO
  • 9: MATRIX_COEFFICIENTS_BT2020_NON_CONST
  • 10: MATRIX_COEFFICIENTS_BT2020_CONST
  • 11: MATRIX_COEFFICIENTS_SMPTE_2085
  • 12: MATRIX_COEFFICIENTS_CHROM_DERIVED_NON_CONST
  • 13: MATRIX_COEFFICIENTS_CHROM_DERIVED_CONST
  • 14: MATRIX_COEFFICIENTS_BT_2100_0
  • 256: MATRIX_COEFFICIENTS_CUSTOM

output_colorimetry.color_primaries

Specifies the chrominance coordinates of the output primaries.
  • -1: COLOR_PRIMARIES_AUTO
  • 1: COLOR_PRIMARIES_BT709_6
  • 2: COLOR_PRIMARIES_UNSPECIFIED
  • 4: COLOR_PRIMARIES_BT470_6_SYSTEM_M
  • 5: COLOR_PRIMARIES_BT470_6_SYSTEM_B_G
  • 6: COLOR_PRIMARIES_SMPTE_170M
  • 7: COLOR_PRIMARIES_SMPTE_240M
  • 8: COLOR_PRIMARIES_GENERIC_FILM
  • 9: COLOR_PRIMARIES_BT2020
  • 10: COLOR_PRIMARIES_SMPTE_ST_428_1
  • 11: COLOR_PRIMARIES_SMPTE_RP_431_2
  • 12: COLOR_PRIMARIES_SMPTE_EG_432_1
  • 22: COLOR_PRIMARIES_EBU_TECH_3213_E
  • 256: COLOR_PRIMARIES_CUSTOM

output_colorimetry.transfer_characteristics

Specifies the gamma correction function of the output.
  • -1: TRANSFER_CHARACTERISTICS_AUTO
  • 1: TRANSFER_CHARACTERISTICS_BT709_6
  • 2: TRANSFER_CHARACTERISTICS_UNSPECIFIED
  • 4: TRANSFER_CHARACTERISTICS_BT470_6_SYSTEM_M
  • 5: TRANSFER_CHARACTERISTICS_BT470_6_SYSTEM_B_G
  • 6: TRANSFER_CHARACTERISTICS_BT601_6
  • 7: TRANSFER_CHARACTERISTICS_SMPTE_240M
  • 8: TRANSFER_CHARACTERISTICS_LINEAR
  • 9: TRANSFER_CHARACTERISTICS_LOGARITHMIC_1
  • 10: TRANSFER_CHARACTERISTICS_LOGARITHMIC_2
  • 11: TRANSFER_CHARACTERISTICS_IEC_61966_2_4
  • 12: TRANSFER_CHARACTERISTICS_BT_1361_0
  • 13: TRANSFER_CHARACTERISTICS_IEC_61966_2_1
  • 14: TRANSFER_CHARACTERISTICS_BT2020_10BIT
  • 15: TRANSFER_CHARACTERISTICS_BT2020_12BIT
  • 16: TRANSFER_CHARACTERISTICS_SMPTE_ST_2084
  • 17: TRANSFER_CHARACTERISTICS_SMPTE_ST_428_1
  • 18: TRANSFER_CHARACTERISTICS_BT2100_HLG
  • 256: TRANSFER_CHARACTERISTICS_CUSTOM

output_colorimetry.matrix_coefficients

Defines the output's coefficients for getting YUV to RGB or inverse conversion.
  • -1: MATRIX_COEFFICIENTS_AUTO
  • 0: MATRIX_COEFFICIENTS_IDENTITY
  • 1: MATRIX_COEFFICIENTS_BT709_6
  • 2: MATRIX_COEFFICIENTS_UNSPECIFIED
  • 4: MATRIX_COEFFICIENTS_FCC
  • 5: MATRIX_COEFFICIENTS_BT470_6_SYSTEM_B_G
  • 6: MATRIX_COEFFICIENTS_BT601_6
  • 7: MATRIX_COEFFICIENTS_SMPTE_240M
  • 8: MATRIX_COEFFICIENTS_YCGCO
  • 9: MATRIX_COEFFICIENTS_BT2020_NON_CONST
  • 10: MATRIX_COEFFICIENTS_BT2020_CONST
  • 11: MATRIX_COEFFICIENTS_SMPTE_2085
  • 12: MATRIX_COEFFICIENTS_CHROM_DERIVED_NON_CONST
  • 13: MATRIX_COEFFICIENTS_CHROM_DERIVED_CONST
  • 14: MATRIX_COEFFICIENTS_BT_2100_0
  • 256: MATRIX_COEFFICIENTS_CUSTOM

GOP options

max_intra_period

Maximum GOP length. Maximum distance between two consequent I pictures. This parameter is not responsible for IRAP (Intra Random Access Pictures) placement by itself. There is a dedicated parameter for IRAP control - irap_period. Value range is [1, 360]. The default value is 200.
  • 0: Periodic I-picture placement is disabled. This mode is called "infinite GOP"
  • 1: Only I-picture placement is enabled
  • 2 - 360: Distance between two consequent I pictures

min_intra_period

Minimum GOP length. Minimum distance between two consequent I pictures. This parameter is intended for use with the enabled Scene change detection feature only. Value range is [1, max_intra_period]. The default value is 1.

irap_period

IRAP period in GOP units. Number of GOPs between two consequent IRAP pictures.
  • 0: Only the first picture is an IRAP
  • 1: Every GOP begins with an IRAP
  • n: Every nth GOP begins with an IRAP

fixed_intra_position

A fixed position of I-frames helps to achieve regular IRAP placement when Scene Change Detection is used. The encoder inserts I-frames at positions that is the multiple of I. Only these pictures are taken into account for IRAP placement, I-frames inserted by SCD are just ignored. Finally, the encoder places IRAPs at the positions of max_intra_period x irap_period.
  • 0: Irregular IRAP placement
  • 1: IRAP placement at every (max_intra_period x irap_period)
Note
Regular IRAP placement is ignored when an Infinite GOP is applied.

vscd_mode

Scene Change Detection (SCD) is intended to improve encoded content quality by inserting I picture at the beginning of new scenes. Enabling SCD has side effects; it affects normal I-picture/IRAP placement. Different length of scenes causes a different GOPs length. In this case GOP length is restricted by the range from min_intra_period to max_intra_period. In addition, more frequent I-pictures reduce the distance between two consequent IRAP pictures. To avoid SCD affecting IRAP placement use the fixed_intra_position feature.
  • 0: Disable SCD
  • 1: Enable SCD (default)

scene_change_type

Specifies the scene change picture type that is set by vscd_mode.
  • 0: TRAIL_R with I-slices
  • 1: IDR
  • 2: CRA

intra_period_type

Specifies the intra period picture type that is set by max_intra-period.
  • 0: TRAIL_R with I-slices
  • 1: IDR
  • 2: CRA

pyramid_b_pics

Specifies whether a pyramid GOP structure should be used or not.
  • 0: No reference dependencies for consecutive B pictures
  • 1: Fixed pyramid structure for consecutive B pictures
Pyramid GOP Structure specifies that B-pictures can be additionally reordered and encoded as a reference to increase encoding efficiency. The number of B-pictures for the Pyramid Structure can be changed by using max_num_b_pics parameter. The Pyramid Structure requires at least three B-pictures. The feature can be combined with Adaptive Number of B-pictures (adaptive_num_b_pics). In this case, the encoder will avoid the Pyramid Structure on high-motion scenes. The table below describes which structure is used (B - reference picture, b - non-reference picture).
Number of B-pictures Presentation order Encoding order Number of reference B-pictures
1 b1 b1 0
2 b1 b2 b1 b2 0
3 b1 B2 b3 B2 b1 b3 1
4 b1 B2 b3 b4 B2 b1 b3 b4 1
5 b1 B2 b3 b4 B5 B2 b1 B4 b3 b5 2
6 b1 B2 b3 b4 B5 b6 B2 b1 B5 b3 b4 b6 2
7 b1 B2 b3 b4 B5 b6 b7 B4 B2 b1 b3 B6 b5 b7 3
8 b1 B2 B3 b4 B5 B6 B7 b8 B3 B2 b1 B6 B5 b4 B7 B8 5
9 b1 b2 B3 b4 B5 b6 B7 b8 b9 B5 B3 b1 b2 b4 B7 b6 b8 b9 3
10 b1 B2 b3 B4 b5 B6 b7 B8 B9 b10 B4 B2 b1 b3 B8 B6 b5 b7 B9 b10 5
11 b1 B2 b3 B4 b5 B6 b7 B8 b9 B10 b11 B4 B2 b1 b3 B8 B6 b5 b7 B10 b9 b11 5
Note
Pyramid GOP Structure increases Reordering Delay and Decoder Picture Buffer (DPB) size.

max_num_b_pics

Specifies the maximum number of B-pictures between consecutive I and P pictures. If this value is set to 0, no B pictures are generated. Value range is 0 - 7.

adaptive_num_b_pics

Adaptive number of B-frames. Reduces distance between two consequent P-frames according to temporal complexity.
  • 0: Disable
  • 1: Enable

max_num_ref_pics_p

Specifies the maximum number of reference pictures used on P-pictures from list0.

max_num_ref_pics_b_l0

Maximum number of reference pictures used on B-pictures from list0.

max_num_ref_pics_b_l1

Maximum number of reference pictures used on B-pictures from list1.

quality_metric

Calculates the quality metric.
  • 0: Calculate no metrics
  • 1: Calculate PSNR metrics

Performance options

cpu_opt

Specifies the CPU acceleration mode to be used during encoding.
  • 0: Best possible mode will be used (default)
  • 1: Pure C version without any acceleration will be used
  • 3: Up to Intel SSE41 instructions will be used if possible
  • 4: Up to Intel AVX2 instructions will be used if possible

num_threads

Number of threads to be used during encoding. 0 means auto mode (default), 1 means single threaded encoding, more threads will use more CPUs/cores. Value range is [0, 256].

num_parallel_pics

The number of pictures encoded simultaneously. 0 means auto mode (default). A value in range from 1 to 16 allows to manually set a parallel encoding pictures number.

max_num_reencodings

The maximum number of re-encoding attempts per picture to achieve rate control goals (e.g. bitrate match or HRD conformance). Value in range from 0 to 10; 0 means that re-encodings are disabled.

Picture preprocessing options

deinterlace

Specifies the deinterlace mode of the input pictures.
  • 0: Do not perform deinterlacing
  • 1: Enable deinterlacing to use the first field and interpolate the other field (auto)
  • 2: Keep the top field unchanged and interpolate the other
  • 3: Keep the bottom field unchanged and interpolate the other
  • 4: Blend both fields

input_filtering

Specifies the filtering mode for incoming frames.
  • 0: Disable input filtering
  • 1: Apply median filter by 3x3 kernel
  • 2: Apply mean filter by 3x3 kernel
Note
Filtering improves internal quality metrics like PSNR or SSIM. This is because the filtering is performed prior to encoding and the filtered pictures are used as reference pictures in the quality metrics calculation. It is strongly recommended that you turn off the internal quality metrics to avoid confusion with values.

Picture pre-analysis options

aq_mode

Specifies the adaptive quantization mode.
  • 0: Disable adaptive quantization
  • 2: Enable temporal adaptive quantization

[VVC Layer 0000]

VVC layer settings are covered under:

General layer parameters

level

Specifies the level to maintain conformance of the encoding layer according to the ITU-T H.266 recommendation. If the level is set, then it is used as a restriction for other parameters like width, height, frame rate, etc. For example, the validation fails if the width is greater than allowed by the target level.
  • 16: Level 1
  • 32: Level 2
  • 35: Level 2.1
  • 48: Level 3
  • 51: Level 3.1
  • 64: Level 4
  • 67: Level 4.1
  • 80: Level 5
  • 83: Level 5.1
  • 86: Level 5.2
  • 96: Level 6
  • 99: Level 6.1
  • 102: Level 6.2
  • 105: Level 6.3
  • 1000: Auto

high_tier

Specifies the tier to maintain layer conformance.
  • 0: Main tier
  • 1: High tier

width

Encoded picture's width. The value range is currently restricted to 16832 pixels.

height

Encoded picture's height. The value range is currently restricted to 16832 pixels.

num_tile_cols

Number of vertical tile columns.

num_tile_rows

Number of vertical tile rows.
Note
The range for num_tile_cols and num_tile_rows can be automatically reduced for small resolutions.

CTU settings

dual_tree

Specifies whether to use separate QTBT trees for intra slice luma and chroma channel types or not.
  • 0: Disable
  • 1: Enable

log2_ctu_size

Specifies the CTU size. A lower value could increase the encoding speed on resolutions below 4K.
  • 5: 32x32
  • 6: 64x64
  • 7: 128x128

log2_min_cu_size

Specifies the minimum size of a coding block of luma samples.
  • 2: 4x4
  • 3: 8x8
  • 4: 16x16
  • 5: 32x32
  • 6: 64x64

mtt_depth

Specifies the maximum depth for multi-type tree splitting. The value range is [0, 4]. The default value is 1.
Note
Increasing the value may increase quality, but drastically decrease the encoding speed.

Interprediction settings

motion_search_precision

Specifies sub-pel motion search accuracy.
Value P-pictures Ref. B-pictures Non-ref. B-pictures
0 Up to 1 pix Up to 1 pix Up to 1 pix
1 Up to 1/2 pix Up to 1 pix Up to 1 pix
2 Up to 1/2 pix Up to 1/2 pix Up to 1 pix
3 Up to 1/4 pix Up to 1/2 pix Up to 1 pix
4 Up to 1/4 pix Up to 1/2 pix Up to 1/2 pix
5 Up to 1/4 pix Up to 1/4 pix Up to 1/2 pix
6 Up to 1/4 pix Up to 1/4 pix Up to 1/4 pix

Rate control settings

bit_rate_mode

Specifies the rate control mode.
Value HRD off HRD on
0 Variable bitrate (VBR) Constant bitrate (CBR)
1 Constant quantization (CQT) N/A
2 Variable bitrate (VBR) Variable bitrate (with HRD or constrained VBR)
3 Average quantization (AQP) Average quantization
4 Constant rate factor (CRF) Constant rate factor

qp_i

Specifies a quantization parameter value for I-frames in Const-Q rate control mode. The value range is 0 - 51.

qp_p

Specifies a quantization parameter value for P-frames in Const-Q rate control mode. The value range is 0 - 51.

qp_b

Specifies a quantization parameter value for B-frames in Const-Q rate control mode. The value range is 0 - 51.

min_qp

Restricts the minimum value of the quantization parameter for rate control (except for Const-Q mode). The value range is 0 - 51.

max_qp

Restricts the maximum value of the quantization parameter for rate control (except for Const-Q mode). The value range is 0 - 51.

bit_rate

Target bitrate for rate control in bits per second.

hss_rate

Specifies the maximum bitrate of the corresponding layer for VBR and CBR modes in bits per second. For constant bitrate, this value should match the bit_rate value.

cpb_size

Specifies the CPB (Coded Picture Buffer) size of the current layer in bits.

hrd_conformance

Specifies how to maintain NAL-based HRD (Hypothetical Reference Decoder) conformance model.
  • 0: Do not provide HRD conformance
  • 1: Provide strict HRD conformance; reencode on underflows until max_qp is reached
  • 2: Provide fast HRD conformance; reencode on underflows until max_qp or max_num_reencodings is reached
Note
Fast (2) HRD mode is almost HRD compliant, optimized for speed.

cpb_fullness

Specifies the initial fullness of the CPB in units specified by the cpb_fullness_units parameter.

cpb_fullness_trg

Specifies the target fullness of the CPB in units specified by the cpb_fullness_units parameter.

cpb_fullness_units

Specifies the unit that should be used to set the CPB fullness.
  • 0: Set the CPB fullness in percent
  • 1: Set the CPB fullness in bits
  • 2: Set the CPB fullness in 90 kHz units

bit_rate_scale

Specifies the scale factor for bit_rate and hss_rate.

cpb_size_scale

Specifies the scale factor for cpb_size.

rate_factor

Specifies whether Constant Rate Factor (CRF) should be used or not.
  • 0: Do not use Constant Rate Factor.
  • 1: Use Constant Rate Factor.

Deblock and SAO filter settings

deblocking_filter

Specifies whether a deblocking filter should be used or not.
  • 0: Disable deblocking filter
  • 1: Enable deblocking filter (default)

sao_filter_luma

Specifies whether the SAO (Sample Adaptive Offset) filter for luma samples should be used or not
  • 0: Disable SAO filter for luma
  • 1: Enable SAO filter for luma

sao_filter_chroma

Specifies whether the SAO (Sample Adaptive Offset) filter for chroma samples should be used or not.
  • 0: Disable SAO filter for chroma
  • 1: Enable SAO filter for chroma

sao_on_ref_b_pics

Specifies whether the SAO filter should be used on referenced B-pictures or not.
  • 0: Disable SAO filter on referenced B-pictures
  • 1: Enable SAO filter on referenced B-pictures

alf_filter

Specifies the Adaptive Loop Filter (ALF) mode.
  • 0: Disables ALF filter
  • 1: Enables ALF filter on luma component
  • 2: Enables ALF filter on luma and chroma component
  • 3: Enables non-linear ALF filter

ccalf_filter

Specifies the Cross Component Adaptive Loop Filter (CCALF) mode.
  • 0: Disables CCALF filter
  • 1: Enables CCALF filter
  • 2: Enables non-linear CCALF filter

Miscellaneous settings

write_vps

Specifies whether to write the VPS (Video Parameter Set) or not. Potentially required for successful decoding by some software decoders or TVs.
  • 0: Do not write VPS (default)
  • 1: Write VPS

Quantization settings

sign_data_hiding

Reduces entropy bits usage by keeping the sign of the coefficients similar. It usually improves quality, but slightly slows down the encoder.
  • 0: Disable sign hide quantization
  • 1: Enable sign hide quantization (default)

rdo_quantization

Specifies the rate-distortion optimized quantization type.
  • 0: Normal quantization
  • 1: RDO quantization