Encoding Parameters
level
Sets the level for encoding. If level=0 the encoder will automatically determine the level based on picture size, frame rate and bitrate. If specified, the level will be used.
When a non-zero level is specified, the encoder will use it regardless of the encoder parameters.
| Not Applicable | JPEG |
| Supported Values | Decimal values from 0 to 9.9 in 0.1 increments H.264 levels: - 1, 1.1, 1.2, 1.3, - 2, 2.1, 2.2, - 3, 3.1, 3.2, - 4, 4.1, 4.2, - 5, 5.1, 5.2, - 6, 6.1, 6.2 H.265 levels: - 1, 2, 2.1, - 3, 3.1, - 4, 4.1, - 5, 5.1, 5.2, - 6, 6.1, 6.2 AV1 levels: - 2.0, 2.1, - 3.0, 3.1, - 4.0, 4.1, - 5.0, 5.1, 5.2, 5.3 - 6.0, 6.1, 6.2, 6.3 |
| Default | 0 |
profile
Sets the profile for encoding. The valid profiles for H.264 and H.265 are shown below.
Any profile can be used for 8 bit encoding, but only the 10 bit profiles (main10 for H.265 and high10 for h.264) may be used for 10 bit encoding.
For the H.264 baseline, the GOP must not contain any B frames, therefore the only supported values for gopPresetIdx are 1, 9, 10 or 0 (custom GOP with picType != 3)
| Not Applicable | JPEG |
| Supported Values | H.265: - 1=main (8 bit default) - 2= main10 (10 bit default) H.264: - 1=baseline (not compatible with B frames) - 2=main - 4=high (8 bit default) - 5= high10 (10 bit default) AV1: - 1=main (8 bit and 10 bit default) |
| Default | H.265: - 1=main (8 bit default) - 2= main10 (10 bit default) H.264: - 4=high (8 bit default) - 5= high10 (10 bit default) AV1: - 1=main (8 bit and 10 bit default) |
high-tier
Sets the tier for AV1 and H.265 encoding.
High tier only takes effect if the current level supports it.
| Not Applicable | - JPEG - H.264 - Rejected when high-tier=1, ignored otherwise |
| Supported Values | - 0: Main tier - 1: High tier |
| Default | - 0 for H.265 - 1 for AV1 |
av1OpLevel
Specifies level for each AV1 operating point. This parameter takes up to 4 integer (E.g. 51 for level 5.1) or decimal values separated by commas, each value indicating the level for an operating point, starting from operating 0 to the highest. When this parameter is not specified or set to 0, firmware will automatically determine the level for each AV1 operating point.
This parameter is generally used only for AV1 spatial layers encoding. When this parameter is specified, the number of comma separated values must match with the number of spatial layers specified by spatialLayers parameter. A sample ffmpeg command is as follows:
ffmpeg -loglevel info -vsync 0 -i base_layer.mp4 -i enhancement_layer.mp4 -filter_complex "[0:v][1:v]interleave=2" -r 50 -c:v av1_ni_quadra_enc -xcoder-params "spatialLayers=2:spatialLayersRefBaseLayer=1:RcEnable=1:spatialLayerBitrate=10000000,1000000:av1OpLevel=5.0,5.1:intraPeriod=120" -y out.mp4
this parameter cannot be used in conjunction with level
| Not Applicable | H.264, H.265, JPEG |
| Supported Values | AV1 levels: - 2.0, 2.1, - 3.0, 3.1, - 4.0, 4.1, - 5.0, 5.1, 5.2, 5.3 - 6.0, 6.1, 6.2, 6.3 |
| Default | 0: Encoder automatically determines the level |
hrdEnable
Enable hypothetical reference decoder (HRD) compliance.
When enabled this parameter will:
- Update the HRD parameters in the VUI
- Send the pic timing sei messages in the bitstream
- Send the buffering period sei messages in the bitstream
- Automatically set RcEnable = 1 if RcEnable is not already enabled
hrdEnable is automatically enabled when dolbyVisionProfile = 5
Please note that encoder cannot guarantee HRD conformance when multicoreJointMode is set to 1, so it is recommended not to enable multicoreJointMode when strict adherence to HRD conformance is required
Please note that currently Quadra does not support HRD conformance for multi layered encoding. Therefore, it is not allowed to set temporalLayersEnable to 1 when HRD conformance is enabled
| Not Applicable | JPEG and AV1 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
enableAUD
Specifies whether to include Access Unit Delimiters (AUD) or not.
Required For:
AUDs are required for DolbyVision compatibility, or when placing bitstreams in transport streams.
| Not Applicable | JPEG and AV1 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
dolbyVisionProfile
Configures the Netint encoder as a 3rd party encoder with the Dolby Encoding Engine. Overrides VUI colour parameters as per DolbyVision profile 5 requirements (video_format=1 (full-range), colour_primaries=transfer_characteristics=matrix_coeffs=2 (unspecified), chroma_loc_info_present_flag=0) and enables AUD and HRD.
When dolbyVisionProfile is enabled:
- Automatically set RcEnable = 1
- Automatically set hrdEnable = 1
- Automatically set default vbvBufferSize = 3000
- Automatically set enableAUD = 1
| Applicable | - H.265 only - FFmpeg version 4.3.1 and above |
| Not Applicable | - JPEG, AV1 and H.264 - FFmpeg version 4.2.1 and earlier |
| Supported Values | - 0 - 5 |
| Default | 0: Disabled |
maxCLL
Specifies parameters for HDR Content Light Level Info as per CEA 861.3. Specified as a string with format “%hu,%hu” where %hu are unsigned 16 bit integers. The first value is the maximum content light level (or 0 if no maximum is indicated), the second value is the maximum picture average light level (or 0). For example, for MaxCLL=1000 nits, MaxFALL=400 nits: max-cll =“1000,400”. Note that this string value will need to be escaped or quoted to protect against shell expansion on many platforms. When this parameter is specified, it will be used in preference to content light level info side data of FFmpeg AVFrame.
| Not Applicable | JPEG and AV1 |
| Default: | None – Use side data values if present |
masterDisplay
Specifies parameters for the HDR Mastering Display Colour Volume SEI as per SMPTE ST 2086. Specified as a string with format: “G(%hu,%hu)B(%hu,%hu)R(%hu,%hu)WP(%hu,%hu)L(%u,%u)” where %hu are unsigned 16bit integers and %u are unsigned 32bit integers. The SEI includes X,Y display primaries for RGB channels and white point (WP) in units of 0.00002 and max,min luminance (L) values in units of 0.0001 nits
For example for a P3D65 1000-nits monitor, where
G(x=0.265, y=0.690), B(x=0.150, y=0.060), R(x=0.680, y=0.320), WP(x=0.3127, y=0.3290), L(max=1000, min=0.0001): “G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)”
Note that this string value will need to be escaped or quoted to protect against shell expansion on many platforms. When this parameter is specified, it will be used in preference to mastering display info side data of FFmpeg AVFrame.
| Not Applicable | JPEG and AV1 |
| Default | None – Use side data values if present |
enableAllSeiPassthru
All custom SEI types will be passed through if this is enabled. Also, when enabled, the firmware SEI will be disabled.
If the enableAllSeiPassthru parameter is enabled (set to 1) for decoding, then the enableAllSeiPassthru parameter for encoding must also be enabled (set to 1).
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0 |
useLowDelayPocType
When enabled, the encoder will use picture_order_count_type=2 in the H.264 SPS, this tells the decoders all frames are in sequence, this typically results in a lower decoding delay. This feature is only supported for H.264 when all frames are reference frames, i.e, when using gop presets gopPresetIdx=1, 3, 7, and 9. For custom gop (gopPresetIdx 0), this feature is only supported for custom gop size 1. By default, this feature is disabled, and the encoder uses picture_order_count_type=0, which is compatible with all gops.
| Not Applicable | JPEG, H265, and AV1 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disabled |
confWinTop
Conformance top window size. This is the number of pixel rows at the top of the picture that should not be displayed when decoding. This is in addition to any cropping info that may already be included on the AVFrame to be encoded.
| Not Applicable | AV1 and JPEG |
| Supported Values | 0 to 8192 |
| Default | 0 |
confWinBot
Conformance bottom window size. This is the number of pixel rows at the bottom of the picture that should not be displayed when decoding. This is in addition to any cropping info that may already be included on the AVFrame to be encoded.
| Not Applicable | AV1 and JPEG |
| Supported Values | 0 to 8192 |
| Default | 0 |
confWinLeft
Conformance left window size. This is the number of pixel columns at the left side of the picture that should not be displayed when decoding. This is in addition to any cropping info that may already be included on the AVFrame to be encoded
| Not Applicable | AV1 and JPEG |
| Supported Values | 0 to 8192 |
| Default | 0 |
confWinRight
Conformance right window size. This is the number of pixel columns at the right side of the picture that should not be displayed when decoding. This is in addition to any cropping info that may already be included on the AVFrame to be encoded
| Not Applicable | AV1 and JPEG |
| Supported Values | 0 to 8192 |
| Default | 0 |
repeatHeaders
Specifies whether the encoder repeats the VPS/SPS/PPS headers on all I frames. Or if intra refresh is enabled, headers are repeated on P frames at IntraRefreshMinPeriod.
For HDR/HDR10+ streams, the static HDR SEIs (content light level info, mastering display colour volume, and alternative transfer characterics) if present are also repeated. Repeated headers permit a bitstream to be decoded mid-stream. It also provides error resilience, in case packets were lost during transmission.
| Not Applicable | AV1 and JPEG |
| Supported Values | - 0: disable - 1: enable |
| Default | 1: enable |
prefTRC
Specifies the HLG preferred transfer characteristics value. If this parameter is present, the encoder will include an alternative transfer characteristics metadata in the bitstream with the preferred transfer characteristics field set to the value of this parameter. If the parameter is not present, the SEI will not be present. The alternative transfer characteristics metadata is required by ETSI for HLG and specifies an alternative transfer characteristic from that provided in the VUI.
| Not Applicable | JPEG |
| Supported Values | 0 to 255 |
| Default | Alternative Transfer Characteristics metadata is not present |
sliceMode
Enable multi-slice encoding. Must be used in conjunction with parameter sliceArg.
| Not Applicable | JPEG and AV1 |
| Supported Values | - 0: single slice per frame - 1: multiple slices per frame |
| Default | 0 |
sliceArg
If sliceMode is enabled, this represents the number of CTU/MB rows in each slice. Value must be between 1 and number of CTU/MB rows in the picture. The number of rows is calculated by height/64 (H.265) or by height/16 (H.264).
sliceNum is number of slices in one frame.
sliceNum = (ctbPerCol + sliceArg - 1) / sliceArg.
need to keep sliceNum < = 256, if sliceNum > 256, sliceArg will increase one automatically until sliceNum < = 256
| Not Applicable | JPEG and AV1 |
| Supported Values | 1 to minimum value between number of CTU/MB rows and 127 |
| Default | 0 (invalid) |
entropyCodingMode
Selects the entropy coding mode used in the encoding process. Note that CABAC is only compatible with H.264 Main, High, and High10 profiles and is disabled for other profiles.
| Not Applicable | JPEG, AV1, and H.265 |
| Supported Values | - 0: CAVLC - 1: CABAC |
| Default | 1 |
framerate
The numerator of the frame rate. This works in conjunction with frameRateDenom to support fractional framerates. The frameRate is used by the encoder for rate control (when enabled) and to set the VUI timing information. If not specified, the frameRate passed in from FFmpeg (or 3rd party application) is used. This parameter is intended for integrating directly with libxcoder.
| Supported Values | 1 to 216-1 |
| Default | FFmpeg Value |
frameRateDenom
The encoder frame rate denominator that supports fraction frame rate together with frameRate. The frame rate would then be frameRate / frameRateDenom, e.g. frameRate=30000 and frameRateDenom=1001 represents frame rate of 30000/1001=29.97. This parameter is intended for integrating directly with libxcoder.
| Supported Values | 1 to 216-1 |
| Default | FFmpeg Value |
colorPri
Specifies one of the VUI color description parameters: color_primaries. The supported values are defined as AVColorPrimaries in FFmpeg, and ni_color_primaries_t in libxcoder. If colorPri, colorTrc, or colorSpc is not equal to 2 (unspecified), the relevant VUI parameters are added to the sequence header.
| Not Applicable | JPEG |
| Supported Values | 0-12, 22 |
| Default | FFmpeg value |
colorTrc
Specifies one of the VUI color description parameters: transfer_characteristics. The supported values are defined as AVColorTransferCharacteristic in FFmpeg, and ni_color_transfer_characteristic_t in libxcoder. If colorPri, colorTrc, or colorSpc is not equal to 2 (unspecified), the relevant VUI parameters are added to the sequence header.
| Not Applicable | JPEG |
| Supported Values | 0-18 |
| Default | FFmpeg value |
colorSpc
Specifies one of the VUI color description parameters: matrix_coeffs. The supported values are defined as AVColorSpace in FFmpeg, and ni_color_space_t in libxcoder. If colorPri, colorTrc, or colorSpc is not equal to 2 (unspecified), the relevant VUI parameters are added to the sequence header.
| Not Applicable | JPEG |
| Supported Values | 0-14 |
| Default | FFmpeg value |
sarNum, sarDenom
Specifies the VUI sample aspect ratio aspect_ratio_idc, as sarNum : sarDenom. When sarNum is 0, aspect_ratio_idc is not included in VUI. When sarNum is greater than 0, the aspect_ratio_idc is included in VUI. This parameter is intended for integrating directly with libxcoder.
A user must use the matching sarNum and sarDenom to the actual picture. Otherwise, there will be a discrepancy between the value in the VUI and the actual.
| Not Applicable | JPEG,AV1 |
| Supported Values | 0-65535 |
| Default | FFmpeg value |
videoFullRangeFlag
Specifies the VUI video_full_range_flag parameter value. When it is 1, the relevant VUI parameters are added to the sequence header.
A user must use the matching value to the actual picture. Otherwise, there will be a discrepancy between the value in the VUI and the actual.
| Not Applicable | JPEG |
| Supported Values | 0 or 1 |
| Default | FFmpeg value |
av1ErrorResilientMode
Specifies whether AV1 error resilient mode is enabled. AV1 error resilient mode allows the syntax of a frame to be parsed independently of previously decoded frames. Note that enabling AV1 error resilient mode may reduce compression efficiency. Also note that error resilient mode is only applicable to AV1, enabling this mode has no effect on other codecs.
Please note that enabling AV1 error resilient mode may reduce compression efficiency. Our test results showed that enabling AV1 error resilient mode can cause up to more than 5% of BD rate loss, and the average BD rate loss is around ~2.42%
| Not Applicable | JPEG, H.264, and H.265 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disabled |
disableAv1TimingInfo
By default, Quadra AV1 encoder signals timing info (refer to AV1 spec 5.5.3 Timing info syntax) in sequence header. When timing info is present, AV1 decoder model will assume default parameters (refer to AV1 spec E.3.1 Resource availability mode). This may cause decoders or video analyzing tools to report decoder model conformance issues, if the encoder rate control mode is not CBR mode, or if the rate control bitrate and buffer size settings are not confined to match with decoder model default parameters.
To avoid decoder model conformance issues, the user may set disableAv1TimingInfo to 1 to disable timing info. The downside of disabling timing info is that framerate information will not be available in the sequence header. However, this typically causes no harm since AV1's minimum viable format—the IVF container—provides framerate signaling, as do all multimedia containers like MP4 and AVI.
| Not Applicable | JPEG, H.264, and H.265 |
| Supported Values | - 0: Enable AV1 timing info - 1: Disable AV1 timing info |
| Default | 0: Enable AV1 timing info |
temporalLayersEnable
Enables temporal scalability with SVC (Scalable Video Coding). When enabled, temporal layers related syntax is added to bitstream. For temporal IDs assignments for each preset gop pattern, please refer to section 8.4.3.2 - Pre-defined GOP Structure.
For custom gop pattern (gopPresetIdx 0), SVC temproal layers syntax is added to bitstream when temporal IDs specified in Custom Gop Parameters (xcoder-gop) are greater than 0, regardless of temporalLayersEnable. Please refer to section 8.4.3.1 - Custom Gop Structure for information regarding Custom Gop Parameters
Please note that currently Quadra does not support HRD conformance for multi layered encoding. Therefore, it is not allowed to set temporalLayersEnable to 1 when HRD conformance is enabled by hrdEnable parameter
| Not Applicable | JPEG |
| Supported Values | - 0: Disabled - 1: Enabled |
| Default | 0: Disabled |
ppsInitQp
Specifies h.264 pic_init_qp_minus26 or h.265 init_qp_minus26 in Picture Parameter Sets. When specified, every Picture Parameter Set in the h.264 or h.265 bitstream will signal the specified ppsInitQp value for init_qp_minus26 syntax - instead of setting init_qp_minus26 according to the initial QP value decided by firmware, which is the default behavior when user does not specify ppsInitQP.
When ppsInitQp parameter is not specified, firmware sets PPS init_qp_minus26 according to the initial QP, which is automatically decided by the firmware
ppsInitQp parameter is not applicable to AV1 and JPEG
| Not Applicable | AV1 and JPEG |
| Supported Values | 0 to 51 |
| Default | FW automatically decided initial QP value |
spatialLayers
Specifies the number of spatial layers in AV1 encoding. Setting spatialLayers > 1 enables AV1 spatial scalability with multiple spatial layers. Quadra supports up to 4 spatial layers.
Please note that Quadra does not support spatial layers with different resolutions, all spatial layers must have the same resolution. Also, Quadra expects input frames to be in spatial layers order. For example, first input frame is in Base Layer, second input frame is in Enhancement Layer 1, third input frame is in Enhancement Layer 2, and so on
Please note that resolution change is not supported when encoding multiple spatial layers. For example, transitioning from 1080p to 720p is not allowed in multi-spatial-layer encode.
When AV1 spatial scalability is enabled (by setting spatialLayers > 1), cross layers referencing is enabled, and the reference hierarchy or gop pattern is no longer decided by gopPresetIdx; therefore, specifying gopPresetIdx with multiple spatialLayers is prohibited. By default, each EL (Enhancement Layer) frame refers to the frame one layer lower. If spatialLayersRefBaseLayer is set to 1, each EL frame will refer to the BL (Base Layer) frame instead of the lower layer frame. Please refer to section “8.4.3.4 - AV1 Spatial Layers Gop Patterns” for illustrations of cross layer reference hierarchies when AV1 spatial scalability is enabled.
There are 2 rate control methods available to spatial layers – (1) The first method is to configure the combined bitrate of all layers by bitrate parameter. For example, bitrate=5000000 allows all layers to produce up to 5Mbps (2) The second method is to configure the bitrate of each layer separately by spatialLayerBitrate parameter, please refer to spatialLayerBitrate parameter descriptions for more details as well as a sample command string
When spatialLayers \ > 1, intraPeriod represents number of temporal units count instead of number of frames. For example, when encoding with 4 spatial layers, each temporal unit includes 4 frames. Assuming framerate is 60, there will be 60 temporal units or 240 frames per second. In this case, setting intraPeriod 60 will cause a key frame to be inserted every second in the base layer. Also, same as in single layer encoding, intraPeriod is 120 by default. If no key frame interval is required, intraPeriod must be specified to 0.
Encoding with multiple spatial layers causes higher VPU load due the increased number of frames to be encoded per second. To improve performance and reduce latency, it is recommended to enable multicoreJointMode in multi-spatial layers encoding to utilize all VPU cores simultaneously
Lookahead is supported when encoding with multiple spatial layers. Please refer to lookaheadDepth parameter descriptions for more information
| Not Applicable | H.264, H.265, JPEG |
| Supported Values | 1 ~ 4: Support up 4 spatial layers. Set 1 to disable AV1 spatial scalability, \ > 1 to enable AV1 spatial scalability |
| Default | 1: AV1 spatial scalability disabled |
spatialLayersRefBaseLayer
When spatialLayersRefBaseLayer is enabled, each EL (Enhancement Layer) frame will refer to the BL (Base Layer) frame instead of the lower layer frame. Please refer to section “8.4.3.4 - AV1 Spatial Layers Gop Patterns” for illustrations of cross layer reference hierarchies when spatialLayersRefBaseLayer is enabled.
spatialLayersRefBaseLayer only takes effects when spatialLayers is greater than 2
| Not Applicable | H.264, H.265, JPEG |
| Supported Values | 0: Disable. When disabled, each Enhancement Layer frame references the lower layer frame 1: Enable. When enabled, each Enhancement Layer frame references the Base layer frame |
| Default | 0: Disabled |
spatialLayerBitrate
Specifies the target bitrate of each AV1 spatial layer. This parameter takes up to 4 integer values separated by commas. When this parameter is specified, the rate control of each AV1 spatial layer is separated from each other and each conforms to its own target bitrate as specified with this parameter. This can guarantee that the base layer always remains the same when it’s encoded with different enhancement layers, as long as the encoding parameters are the same. This parameter can also be used in conjunction with spatialLayers=1 (single layer encoding), which alters single layer rate control and gop structure to match with the base layer of a multi-layers bitstream. When this parameter is specified, the number of comma separated values must match with the number of spatial layers. Also note that when this parameter is specified, the bitrate parameter will not take effects. A sample FFmpeg command is as follows:
ffmpeg -vsync 0 -i base_layer.mp4 -i enhancement_layer_1.mp4 -i enhancement_layer_2.mp4 -i enhancement_layer_3.mp4 -filter_complex "[0:v][1:v][2:v][3:v]interleave=4" -r 60 -c:v av1_ni_quadra_enc -xcoder-params rcEnable=1:bitrateMode=1:vbvBufferSize=2000:cuLevelRCEnable=1:intraPeriod=60:spatialLayers=4:spatialLayersRefBaseLayer=1:spatialLayerBitrate=5000000,2000000,1500000,1000000 out.mp4
As shown in the example command above, the first value (5000000) is the target bitrate for base layer, the second value (2000000) is the target bitrate for the first enhancement layer, and so on for the second and third enhancement layers.
spatialLayerBitrate supports CBR, ABR, CRF and Capped CRF rate control modes
The following features are not supported when this parameter is used:
- dynamic encoder parameter reconfiguration (e.g. reconfDemoMode) NOTE – when spatialLayerBitrate is used in conjunction with spatialLayers=1 (single layer encoding) to produce output matching with the base layer of a multi spatial layer bitstream
- the single layer encoding gop pattern is no longer decided by gopPresetIdx; therefore, specifying gopPresetIdx is prohibited
- in case the multi spatial layer bitstream to match with was encoded with multicoreJointMode, the single layer encoding must additionally set av1ErrorResilientMode to produce output matching with the base layer of the multi spatial layer bitstream
| Not Applicable | H.264, H.265, JPEG |
| Supported Values | The range of valid bitrate value for each spatial layer is 10000 to 800000000 |
| Default | 0 for all spatial layers, meaning that the rate control of spatial layers is not separated |
enableTimecode
When enabled, set the pic_struct_present flag in VUI to 1. This is needed for properly inserting timecode data into the picture timing SEI in H264. See section 6.6.7.6 in the libxcoder API integration guide for more details on how to insert timecode data into SEI.
This option should only be enabled when the ni_enc_insert_timecode function (from ni_av_codec.h in libxcoder) is called to insert timecode data in SEI for each frame. If only enabling this option, the pic_struct_present flag in VUI will be set to 1 but there won’t be any pic_timing SEI added. On the other hand, if only ni_enc_insert_timecode function is called, pic_timing SEI will be added but the pic_struct_present flag in VUI will remain 0, which will cause the timecode data in pic_timing SEI to be ignored.
This option is only valid for H264. It does not have any effect when using other codecs.
| Not Applicable | H265, AV1 and JPEG |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
avccHvcc
When this flag is disabled, the encoder produces a byte stream where NALUs are sent sequentially, as specified by Annex B. Each NALU is preceded by a Start Code Prefix, which is not allowed to appear within the NALU itself.
When it is enabled, the firmware encoder generates the bitstream in AVCC/HVCC. The encoder generates [Codec]DecoderConfigurationBox followed by NALUs, where [Codec] can be either ‘AVC’ or ‘HEVC’. Refer to the table below for the syntax details. Each NALU, following this configuration box, is preceded by its length rather than a Start Code Prefix.
| Field of Box | Description | Length |
|---|---|---|
| size | Length of the whole box including ‘size’ field | 4 bytes |
| type | ‘avcC’ or ‘hvcC’ | 4 bytes |
| [Codec]DecoderConfigurationRecord | Refer to ISO 14496-15 | variable |
The primary purpose of this option is to facilitate the construction of bitstream within a container, such as MP4, without the need to convert from AnnexB to AVCC/HVCC. It is important to note that the generated bitstream is not final and requires further processing into a container.
This option is applicable only for generating elementary stream formats of H.264 and H.265. When using an FFMPEG command-line operation, it is essential to use 'h264' or 'h265' and avoid using container file extensions in the output file name.
This option is not supported on FFmpeg 7.1, FFmpeg 7.1.3, FFmpeg 8.0.1 and FFmpeg-n8.1.
| Not Applicable | AV1 and JPEG |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disabled |
clearRefListModification
Clears ref_pic_list_modification_flag_l0 in H.264 P-slice headers and removes the associated reference-picture-list reordering commands. Only the slice header is rewritten; the coded slice data is left unchanged. This produces P slices that use the default reference-picture-list ordering.
This option modifies only H.264 P slices; B slices and all other slice types are left untouched. It is safe to use when each P slice uses a single reference picture, so that the reordering commands are redundant (they reproduce the default reference-picture list) and clearing them does not change how the stream decodes. Do not enable it for streams that use P slices with multiple reference pictures or long-term references, as removing the reordering may change which reference each P-slice macroblock predicts from and corrupt the decoded output.
When entropyCodingMode is 0 (CAVLC), the slice data is bit-shifted to close the gap left by the removed commands; when it is 1 (CABAC), the byte-aligned slice data is copied unchanged.
| Not Applicable | H265, AV1 and JPEG |
| Supported Values | - 0: Disable - 1: Enable (clear ref_pic_list_modification_flag_l0 in P slices) |
| Default | 0: Disabled |
Libxcoder Application Features
lowDelay
Specifies whether or not to enable the low latency mode in encoding. When enabled, libxcoder increases its rate of polling the encoder and only permits buffering of a single frame to minimize the delay.
That when enabled, the gopPresetIdx must be 1, 3, 7, 9, 10, or 0 with a consecutive order gop pattern, lookaheadDepth must be 0, and multicoreJointMode must be 0.
That in libxcoder encoder send/receive multi-thread mode, when enabled, its value can be a positive integer value in milliseconds for threads synchronization. It represents the time the sending thread waits before deciding it’s in a deadlock and has to continue without waiting for receiving thread to signal.
| Not Applicable | JPEG |
| Supported Values | - 0: disable - Positive integer: enable |
| Default | 0: disable |
minFramesDelay
Specifies whether to enable the minimum encoding delay frames feature. When enabled, libxcoder increases its rate of polling the encoder and only permits buffering of the minimum frames to minimize the delay.
The minimum encoding delay frames feature supports all gopPresetIdx values and is compatible with lookaheadDepth.
The minimum encoding delay depends on both the GOP size and the lookahead depth.
For example, when gopPresetIdx = 5 and lookaheadDepth = 4, the minimum encoding delay is 3 frames, meaning that the application must submit 4 input frames before the encoder produces the first output packet.
For minFramesDelay = 5, it will try to flush when get I frame, it can reduce the latency when meet irregular gop
| Not Applicable | JPEG |
| Supported Values | - 0: disable - 1: enable - 2: enable, keep output fps stable - 5: enable, flush before I frame to reduce delay - 6: enable, keep output fps stable and flush before I frame to reduce delay |
| Default | 0 |
keepAliveTimeout
Specifies a session keep alive timeout value. This is a periodic request/response between libxcoder and XCoder firmware that when timed out, the session instance will be terminated by XCoder firmware*.* If this option is used in conjunction with FFmpeg command line option keep_alive_timeout then keepAliveTimeout overrides keep_alive_timeout.
| Supported Values | Integer in the range 1 to 100 |
| Default | 3 |
zeroCopyMode
Enable or disable libxcoder zero copy feature. When zero copy is disabled, libxcoder copies YUV data from input frame buffer(s) to consecutive internal buffer before transferring data to device. This reduces overhead by triggering data transfer only once.
When zero copy is enabled, libxcoder transfers data directly from input frame buffer(s) (luma / chroma buffers can be inconsecutive) to device, which improves performance when encoding high resolution / large frames.
The default setting is auto mode, in which libxcoder decides whether to enable or disable zero copy based on input resolution – zero copy is enabled if input resolution > = 1080p, and disabled if input resolution < 1080p. Auto mode's zero copy enable / disable is based on performance test results, and therefore is the suggested setting.
For applications based on libxcoder instead of calling FFMpeg libavcodec functions, please refer to libxcoder_API_IntegrationGuide section 6.6.2 - “Input YUV Frame Preparation” regarding the libxcoder APIs required to use the zero copy feature. Otherwise zero copy will not take effect regardless of the zeroCopyMode setting.
Zero copy only applies to input frames which meet the following requirements
- YUV420 8 or 10 bit planar/semi-planar pixel format, or RGBA / BGRA / ABGR / ARGB
- Input frame width and height are 2-pixels aligned
- Input frame linesizes (aka strides) of luma / chroma buffers are 2-bytes aligned
- Input frame resolution > = 144x128
- Each input frame’s linesize shall be the same throughout the entire encoding session
| Supported Values | - 0: Disable zero copy (For any input resolution) - 1: Enable zero copy (For any input resolution) - -1: Auto mode (Enable zero copy if input resolution > = 1080p, disable zero copy if input resolution < 1080p) |
| 1 (Enable zero copy for all input resolutions) |
ddrPriorityMode
Specifies the DDR memory priority mode. Only need set once at beginning, and it will reset to default automatic after current process finish.
This is a global setting, it will influence all running processes. It is best to only use it when there is only one process. If there are multiple processes, other processes fps performance may influence by this parameter.
| Supported Values | - 0: set default ddr mode - 1:increase ddr priority for decoder and encoder - 2:increase ddr priority for scaler - 3:increase ddr priority for ai |
| Default | -1 |
statisticOutputLevel
Specify the information output for each frame, statisticOutputLevel = 1 will including the maximum and minimum MV of the macroblocks in the current frame, as well as the number of inter/intra macroblocks in the current frame and the frame size of the current frame. statisticOutputLevel = 6 will include 1-pass satd cost
This feature will decrease the performance because collecting this information is time-consuming.
| Supported Values | - 0: disable - 1: detail info for 1-pass - 6: 1-pass satd cost |
| Default | 0 |
disableAdaptiveBuffers
Specifies whether to disable adaptive buffers when bitstream sequence is changed. When disableAdaptiveBuffers=1 and width/height of pictures is different from previous width/height in sequence change, it will take a little time to re-configure encoder with new width/height.
If this option is used and the output type of decoder is hw in transcoding, the disableAdaptiveBuffers parameter of quadra decoder should be used at same time. If there are many sequence changes in customer’s bitstream, suggest to enable this parameter.
| Not Applicable | JPEG and VP9 |
| Supported Values | - 0: Disable - 1: enable |
| Default | 0: Disable |
Encode Algorithm and Features
preset
Selects a predefined set of encoding parameters to balance encoding speed and compression efficiency. Presets provide a convenient way to configure the encoder with optimized settings for specific use cases, prioritizing either speed or quality. When a preset is used, any additional encoding parameters specified will override the corresponding preset values except RcEnable. RcEnable is always set to 1 and crf to –1 (disabled) since preset is only supported in the CBR mode. If no preset is selected, the encoder applies no predefined parameter set.
The following are example ffmpeg commands:
ffmpeg -vsync 0 -i input.h264 -c:v h265_ni_quadra_enc -xcoder-params preset=medium output.mp4
ffmpeg -vsync 0 -i input.h264 -c:v h265_ni_quadra_enc -preset medium output.mp4
If the predefined parameter values fall outside the supported range for the selected codec or resolution, they will be automatically adjusted to fit within the valid range.
For H.264, the veryfast, faster, and fast presets produce identical results. Similarly, the medium, slow, and slower presets give the same results.
| Not Applicable | JPEG |
| Supported Values | The below lists the predefined encoding parameters for each preset, in the format (RcEnable, EnableRdoQuant, rdoLevel, lookAheadDepth, gopPresetIdx, bitrate, vbvBufferSize, cuLevelRCEnable, tolCtbRcInter, tolCtbRcIntra): - veryfast : (1, 1, 1, 0, 9, 1000000, 1000, 1, 0, -1) - faster: (1, 1, 2, 0, 9, 1000000, 1000, 1, 0, -1) - fast: (1, 1, 3, 0, 9, 1000000, 1000, 1, 0, -1) - medium: (1, 1, 1, 16, -1, 1000000, 3000, 0, 0, 0) - slow: (1, 1, 2, 16, -1, 1000000, 3000, 0, 0, 0) - slower: (1, 1, 3, 16, -1, 1000000, 3000, 0, 0, 0) - veryslow: (1, 1, 3, 40, -1, 1000000, 3000, 0, 0, 0) |
| Default | None – not assigned and all parameters use default values: (0, 0, 1, 0, -1, 200000, 3000, 0, 0, 0) |
rdoLevel
Specifies the number of candidates to use for Rate Distortion Optimization. RDO is a method for improving video quality during compression. Lower values mean a lower quality but better performance, higher values mean more quality but less performance
| Not Applicable | JPEG |
| Supported Values | - H.264: 1 - H.265: 1 to 3 - AV1: 1 to 3 |
| Default | 1 |
EnableRdoQuant
Specifies whether to enable or disable RDO Quantization. RDOQ provides optimized quantization to further improve video quality, with the cost of lower performance
| Not Applicable | AV1 and JPEG |
| Applicable | H.264 and H.265 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0 |
tuneBframeVisual
Specifies whether to enable or disable B-frame visual tuning. B-frame visual tuning helps mitigate subjective quality fluctuation, at the cost of lowered compression efficiency. When enabled, there are 2 modes available – setting tuneBframeVisual to 1 enables MEDIUM tuning mode, in which encoder tunes B-frame visual quality with minor loss in compression efficiency, and setting tuneBframeVisual to 2 enables HIGH tuning mode, in which encoder applies stronger tuning to B-frame visual quality with more compression efficiency loss
Please also note that MEDIUM tuning mode is only applicable to H.264 and H.265, and is only available when lookahead (enabled by lookaheadDepth) or CRF (enabled by crf) encode is enabled
| Not Applicable | JPEG (MEDIUM tuning mode is not applicable to AV1) |
| Supported Values | - 0: Disable - 1: MEDIUM (tune B-frame visual quality with minor loss in compression efficiency) - 2: HIGH (stronger B-frame quality tuning with more compression efficiency loss) |
| Default | 0 |
enable2PassGop
This parameter will affect the group of picture pattern for 2-pass encoding.
By default, it is disabled. Encoder has its own GOP for 2-pass mode when lookahead > 0. GOP will be different from what is described in gopPresetIdx.
When it is enabled, the 2-pass encoding’s GOP is consistent with GOP specified by gopPresetIdx.
For more details, please refer to Section 8.4.3.2 Pre-defined GOP Structure.
| Not Applicable | JPEG |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0 |
lookAheadDepth
Number of frames to lookahead while encoding. Lookahead can increase encoder quality at the expense of performance (approximately 25%) and delay. Note that the input video pixel width must be at least 144 pixels wide.
Enabling CU level RC with lookahead (E.g. cuLevelRc=1 and lookaheadDepth > 0) is generally not recommended, because CU level RC may cause quality degradation to lookahead encode. The only scenario CU level RC should be enabled together in lookahead encode would be when instantaneous bitrate constraint or HRD conformance must be strictly followed – in which case CU level RC would be needed to constraint the bitrate
Due to resource constraints, when transcoding a 8k(7680x4320) 10 bitstream, the maximum value of lookahead is 16.
| Not Applicable | JPEG |
| Supported Values | 0: Disable lookahead 4 to 40: Enable lookahead with lookahead depth in frames (4 to 40 frames). |
| Default | 0 |
noMbTree
When lookahead is enabled, MB Tree / CU Tree is enabled by default. Use the noMbTree parameter to disable MB Tree / CU Tree feature. Because disabling MB Tree / CU Tree can reduce quality and compression efficiency, this setting is not recommended in most cases.
noMbTree only takes effect when lookahead is enabled (lookaheadDepth > 0)
| Not Applicable | JPEG |
| Supported Values | - 0: Do not disable MB Tree / CU Tree feature when lookahead is enabled - 1: Disable MB Tree / CU Tree feature when lookahead is enabled |
| Default | 0 |
totalCuTreeDepth
In live streaming, cloud gaming, or other low delay scenarios, a high lookahead depth setting may not be acceptable due to the extended delay caused by lookahead. In scenarios where increasing lookahead depth is not an option, the user may set totalCuTreeDepth to a number greater than lookahead depth to improve quality. Currently this feature is only supported for gopPresetIdx 5, and the suggested value is lookahead depth + ½ gop size, E.g. for lookaheadDepth=4 and gopPresetIdx=5 (which has gop size 4), the suggested setting for totalCuTreeDepth is 4+(4/2)=6. Please also note enabling this feature will cause up to 9 ~ 10% performance degradation.
To enable this feature, set totalCuTreeDepth to a value larger than lookaheadDepth. Setting totalCuTreeDepth < = lookaheadDepth will not bring any quality enhancement
This feature is only available when lookahead is enabled, E.g. setting totalCuTreeDepth > 0 is not allowed when lookaheadDepth = 0
This feature is only supported for gopPresetIdx = 5, E.g. setting totalCuTreeDepth > lookaheadDepth is only allowed when gopPresetSetIdx = 5
This feature is incompatible to mulitcoreJointMode, E.g. setting totalCuTreeDepth > lookaheadDepth is not allowed when multicoreJointMode = 1
Enabling his feature will cause up to 9 to 10% performance degradation
| Not Applicable | JPEG |
| Supported Values | - 0: Disabled - 4 to 40: Set totalCuTreeDepth to value greater than lookaheadDepth to improve quality. The suggested value is lookahead depth + ½ gop size. |
| Default | 0 |
gopPresetIdx
Defines the Group Of Picture pattern.
By default, encoder uses Adaptive Gop, for which the encoder dynamically adjusts gop pattern while encoding based on statistics collected from previous frames (1-pass) or lookahead (2-pass).
If both coding parameters gopPresetIdx and lookaheadDepth are set, then the gop pattern is different from setting only the coding parameter gopPresetIdx. For details, please refer to Section 8.4.3 Custom Gop Structure.
For 2-pass encoding, the GOP is not only affected by this parameter, but also affected by parameter enable2PassGop. Please refer to it for more details.
| Not Applicable | JPEG |
| Supported Values | - -1: Adaptive Gop (default) - 0 : Custom Gop - 1 : I-I-I-I,..I (all intra, gop_size=1) - 3 : I-B-B-B,…B (consecutive B, gop_size=1) - 4 : I-B-P-B-P,… (gop_size=2) - 5 : I-B-B-B-P,… (gop_size=4) - 7 : I-B-B-B-B,… (consecutive B, gop_size=4) - 8 : I-B-B-B-B-B-B-B-B,… (random access, gop_size=8) - 9 : I-P-P-P,… P (consecutive P, gop_size=1) - 10 : I-P-P-P-P,… (hierarchical P, gop_size=4) |
| Default | -1 |
intraPeriod
Key frame / IDR frame interval.
Please note when spatialLayers \ > 1 (multiple spatial layers), intraPeriod represents number of temporal units count instead of number of frames. For example, when encoding with 4 spatial layers, each temporal unit includes 4 frames. Assuming framerate is 60, there will be 60 temporal units or 240 frames per second. In this case, setting intraPeriod 60 will cause a key frame to be inserted every second in the base layer.
| Supported Values | - 0 to 1024 - 0 implies an infinite period (disables periodic IDR frames) |
| Default | 120 |
intraQP
Specifies intra frame quantization parameter.
The intraQP only takes effect when rate control is disabled e.g. rcEnable = 0
When used for JPEG, the encoder scales the quantization table in the JPEG standard to produce bitstreams of different video quality.
| Supported Values | 0 to 51 |
| Default | 22 |
intraQPDelta
Delta value added to the Intra frame QP. Can be used to lower the Intra Picture encoded size (higher QP) or to increase Intra quality relative to the Inter Pictures (lower QP) to get rid of intra flashing. Recommended value range is –12 to 12.
The intraQpDelta only takes effect when rate control is enabled, eg. rcEnable = 1
After intraQpDelta is applied, the intra frame QP is further adjusted by rate control, which means that the encoded bitstream may not contain the exact value of the user-defined delta depending on the source.
| Supported Values | -51 to 51 |
| Default | -2 |
qLevel
JPEG only. Specifies the quantization scale to produce the different video qualities by scaling the quantization table. Higher values produce better quality.
| Not Applicable | H264, H265, and AV1 |
| Supported Values | 0 to 9 |
minQP
Min QP for rate control.
| Supported Values | 0 to 51 |
| Default | 8 |