Decoder Parameters
out
Specifies the output type of decoder output Out0. Specifies whether a hardware or software frame is returned.
| Supported Values | - sw: Software - hw: Hardware |
| Default | sw: Software |
enableOut1
Enables Decoder output 1. Note that Decoder output 0 is always enabled. Out1 if enabled is always returned as a hardware frame.
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
enableOut2
Enables Decoder output 2. Note that Decoder output 0 is always enabled. Out2 if enabled is always returned as a hardware frame.
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
force8Bit0
When enabled, 10 bit video on output 0 is converted to 8 bit output by shifting down by 2 bits.
| Not Appliable | JPEG, semiplanar0 = 2 with 10-bit input |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
force8Bit1
When enabled, 10 bit video on output 1 is converted to 8 bit output by shifting down by 2 bits.
| Not Appliable | JPEG, semiplanar0 = 2 with 10-bit input |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
force8Bit2
When enabled, 10 bit video on output 2 is converted to 8 bit output by shifting down by 2 bits.
| Not Appliable | JPEG, semiplanar0 = 2 with 10-bit input |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
semiplanar0
When set to 0, the yuv420 format is used, main perk is that it is most compatible with other HW blocks or SW.
When set to 1, yuv output 0 format will be in nv12 or p010le semiplanar format depending on source bit-depth. Improves performance when memory usage is high.
When set to 2, yuv output 0 format will be in a special compressed tiled format. This format greatly improves performance when memory usage is high. Ideal for large resolution 10-bit inputs. Must have HW frames enabled, VP9 not supported, final decoder output resolution (after any crop or scale) must align to multiples of 4, and only compatible with co-located encoder, ni_quadra_scale and ni_quadra_overlay filters for downstream usage.
| Supported Values | - 0: Disable - 1: Enable - 2: Tiled Mode |
| Default | 0: Disable |
semiplanar1
When set to 0, the yuv420 format is used, main perk is that it is most compatible with other HW blocks or SW.
When set to 1, yuv output 1 format will be in nv12 or p010le semiplanar format depending on source bit-depth. Improves performance when memory usage is high.
When set to 2, yuv output 1 format will be in a special compressed tiled format. This format greatly improves performance when memory usage is high. Ideal for large resolution 10-bit inputs. Must have HW frames enabled, VP9 not supported, final decoder output resolution (after any crop or scale) must align to multiples of 4, and only compatible with co-located encoder, ni_quadra_scale and ni_quadra_overlay filters for downstream usage.
| Supported Values | - 0: Disable - 1: Enable - 2: Tiled Mode |
| Default | 0: Disable |
semiplanar2
When set to 0, the yuv420 format is used, main perk is that it is most compatible with other HW blocks or SW.
When set to 1, yuv output 2 format will be in nv12 or p010le semiplanar format depending on source bit-depth. Improves performance when memory usage is high.
When set to 2, yuv output 2 format will be in a special compressed tiled format. This format greatly improves performance when memory usage is high. Ideal for large resolution 10-bit inputs. Must have HW frames enabled, VP9 not supported, final decoder output resolution (after any crop or scale) must align to multiples of 4, and only compatible with co-located encoder, ni_quadra_scale and ni_quadra_overlay filters for downstream usage.
| Supported Values | - 0: Disable - 1: Enable - 2: Tiled Mode |
| Default | 0: Disable |
cropMode0
Specifies the crop mode for output 0. When set to auto, the cropping parameters are determined from the bitstream. When set to manual, the cropping parameters are specified by the crop parameters below.
| Supported Values | - Auto - Manual |
| Default | Auto |
cropMode1
Specifies the crop mode for output 1. When set to auto, the cropping parameters are determined from the bitstream. When set to manual, the cropping parameters are specified by the crop parameters below.
| Supported Values | - Auto - Manual |
| Default | Auto |
cropMode2
Specifies the crop mode for output 2. When set to auto, the cropping parameters are determined from the bitstream. When set to manual, the cropping parameters are specified by the crop parameters below.
| Supported Values | - Auto - Manual |
| Default | Auto |
crop0
Cropping parameters for output 0. When manual mode is selected, specifies the x and y coordinates where cropping begins and the width and height for cropping. Existing header cropping info ignored. Note that the cropping dimensions must be even, and the minimum cropped size is 48x48. Out of bounds offsets will be resized to fit with corresponding width and height values.
| Supported Values | W,H,X,Y. |
| Default | decoded picture width, decoded picture height, 0, 0 |
crop1
Cropping parameters for output 1. specifies the x and y coordinates where cropping begins and the width and height for cropping. Existing header cropping info ignored. Note that the cropping dimensions must be even, and the minimum cropped size is 48x48. Out of bounds offsets will be resized to fit with corresponding width and height values.
| Supported Values | W,H,X,Y. |
| Default | decoded picture width, decoded picture height, 0, 0 |
crop2
Cropping parameters for output 2. When manual mode is selected, specifies the x and y coordinates where cropping begins and the width and height for cropping. Existing header cropping info ignored. Note that the cropping dimensions must be even, and the minimum cropped size is 48x48. Out of bounds offsets will be resized to fit with corresponding width and height values.
| Supported Values | W,H,X,Y. |
| Default | decoded picture width, decoded picture height, 0, 0 |
scale0
Specifies the width (w) and height (h) to scale decoder output 0. If not specified, then no scaling is done. The width and height may be set to no larger than the decoded output size. Note that scaling is applied after any cropping is done. Note that the scaling dimensions must be even, and the minimum scaling size is 2x2.
| Supported Values | W(Width)x H(Height) |
| Default | Disabled |
scale1
Specifies the width (w) and height (h) to scale decoder output 1. If not specified, then no scaling is done. The width and height may be set to no larger than the decoded output size. Note that scaling is applied after any cropping is done. Note that the scaling dimensions must be even, and the minimum scaling size is 2x2. Values are W,X,H.
| Supported Values | W(Width)x H(Height) |
| Default | Disabled |
scale2
Specifies the width (w) and height (h) to scale decoder output 2. If not specified, then no scaling is done. The width and height may be set to no larger than the decoded output size. Note that scaling is applied after any cropping is done. Note that the scaling dimensions must be even, and the minimum scaling size is 2x2.
| Supported Values | W(Width)x H(Height) |
| Default | Disabled |
multicoreJointMode
Enables decoder multi-core mode where all 4 cores work together in parallel (a.k.a. joint mode). When disabled (default), the decoder instances only use a single video core to decode. When enabled, decoder instances use all 4 video decoding cores in parallel. Recommended only for high resolution decoding with less than 4 instances, e.g. 8K decode. When more than 4 decoding instances are used, enabling this feature will lower performance due to extra synchronization overhead.
| Not Applicable | JPEG and VP9 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
lowDelay
Specifies whether to enable the low latency mode in decoding. When enabled, libxcoder uses a different query method that returns upon frame ready to reduce polling. This method only permits buffering of a single frame to minimize delay. If out-of-sequence stream is paired with low delay, longer input buffering may occur and output display order will also be out-of-sequence.
Input also requires POC type = 2
In libxcoder decoder 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 the receiving thread to signal.
| Not Applicable | JPEG or VP9 |
| Supported Values | - 0: Disable - Positive integer: Enable |
| Default | Disabled |
forceLowDelay
By Default, decoder low delay mode will be cancelled automatically if there’s frame drop, i.e, a stream packet sent to decoder is not able to output as a frame. With this option enabled, decoder won’t exit lowDelay mode when frame drop happens. Instead, it will accumulate the number of dropped frames and continue decoding in low delay mode. This option should only be applied when it’s certain that the input stream can be decoded without reordering, else enabling it will break the display order of frames.
If non-sequential input (B frames) is provided, this feature will break the display order of frames.
| Not Applicable | JPEG or VP9 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
enableLowDelayCheck
This function is used to detect the presence of B-frames in the input stream. This function will only take effect when low-delay mode is enabled. If B frames are detected in low delay mode, the low delay function will be turned off.
If it can be determined that the decoding order of the input stream is consistent with the display order, do not enable this function.
| Not Applicable | JPEG or VP9 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0: Disable |
disableReorder
Specifies whether to disable reordering of frames during the decoding process. When set to 1, decoded YUV frames are output in decoding order. If the source bitstream contains B frames, the output display will be out of sequence.
| Not Applicable | JPEG or VP9 |
| Supported Values | - 0: Reordering enabled - 1: Reordering disabled |
| Default | 0: Disable |
keepAliveTimeout
Specifies a session keep alive timeout value. This is a periodical 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 option keep_alive_timeout then keepAliveTimeout overrides keep_alive_timeout.
| Supported Values | Integer in the range 1 to 100 |
| Default | 3 |
customSeiPassthru
Specify a custom SEI type to passthrough.
| Supported Values | Integer in the range -1 to 254 |
| Default | -1 |
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: Disable |
enableUserDataSeiPassthru
Enable user data unregistered SEI passthrough.
The maximum size of user data unregistered SEI message that can be passed through using this feature is 1024 bytes. For larger SEI messages, please use customSeiPassthru parameter.
| Supported Values | Integer of 0 (false) or 1 (true) |
| Default | 0 (false) |
svctDecodingLayer
Specifies the maximum temporal layer ID of frames to be decoded. The decoder will discard frames with temporal layer ID higher than the value specified by this parameter.
this is only for H.264 SVC-T (temporal scalable video coding) decoding. Default value is -1. By default, it will decode all the frames.
| Supported Values | Integer in the range -1 to max integer |
| Default | -1 |
ddrPriorityMode
Specifies the ddr 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 |
ecErrThreshold
Specifies the threshold of broken ratio of a decoder output picture. If a decoded picture has larger broken part than the threshold, it would be considered as a broken picture and won’t be used as a reference picture.
if ecPolicy is set to limited_error, picture with larger broken part than threshold would be dropped.
| Supported Values | - Integer in the range 0 to 100 - 0: a good picture should have no broken part - 100: all pictures are considered good |
| Default | 10 |
ecPolicy
Specifies the error concealment policy that should be used by the decoder when it encounters a broken bitstream. If a frame was not completely decoded because of bitstream errors it can still be used as a reference in H.264/HEVC/VP9 codecs, this will cause lingering artifacts in the subsequent frames that reference one of the frames with decoding errors. The ecPolicy controls how corrupted reference frames are handled during decoding.
Applicable H.264/HEVC/VP9 to only. .
| Not Applicable | Not Supported for tiled Outputs |
| Applicable | H.264, H.265 and VP9 |
| Supported Values | - skip: If no replacement is available, skip decoding of all frames until the next I-frame. - limited_error: Try to replace corrupted reference frames other frames that were previously decoded and are kept in the decoded pictures buffer. If no replacement is available then decoding of all frames will be skipped until the next I-frame. If broken ratio of the output picture is larger than threshold(default 10%), the picture would be dropped. - tolerant: Try to replace corrupted reference frames other frames that were previously decoded and are kept in the decoded pictures buffer. If no replacement is available then decoding of all frames will be skipped until the next I-frame. - best_effort: Try to replace corrupted reference frames with other frames that were previously decoded and are kept in the decoded picture buffer. If no replacement frame is available in the decoded pictures buffer, keep using the original reference frame despite the decoding errors. - ignore: Ignore any decoding errors in reference frames and keep using them as is. - best_effort_out_dc: It’s very similar to best_effort. Compared with best_effort, it will drop frames whose error_ratio is larger than error_ratio_threshold, and it won’t inherit reference frames’ error_ratio if no replacement frame is available. |
| Default | best effort |
enableAdvancedEc
If a frame has not been completely decoded due to bitstream errors, or if a partially decoded reference frame was used to decode the frame, the decoder will conceal the errors in the output pictures. With enableAdvancedEc=1 (the default), part of a previous frame will be copied over the broken part of a partially decoded frame. If no good frame is available or enableAdvancedEc=0, then a solid green color fill will be used to show the error. With enableAdvancedEc=2, part of a previous frame will be copied over the broken part of a partially decoded frame and the additional memory will be kept in whole decoding life.
| Not Applicable | Not Supported for tiled Outputs |
| Applicable | H.264, H.265 and VP9 |
| Supported Values | - 0: Always use a solid green color to conceal partially decoded frames. - 1: Try to use the last good frame to conceal any picture errors - 2: Try to use the last good frame to conceal any picture errors in whole decoding life in the partially decoded frames. With enableAdvancedEc=1, when a broken bitstream is encountered, the decoder will allocate additional memory to hold the last good frame so it can be used for concealment. That is, a slightly higher memory usage must be expected when a corrupted stream is being fed into the decoder, with this option enabled. With enableAdvancedEc=2, when the first good frame is decoded, the decoder will allocate additional memory to hold the last good frame so it can be used for concealment. That is, a slightly higher memory usage must be expected whether the bitstream is a good or corrupted. |
| Default | 1 |
enablePpuScaleAdapt
This parameter is used to enable the PPU scale long and short edge adaptation.
If long edge adaptation is enabled, the resolution of the input stream changes, causing the resolution of the output stream to be recalculated based on the scaling ratio between the short edge and the long edge. For example, if the initial input stream is 1920x1080, and the ppuscale is set to 960x360, and long edge adaptation is enabled, then the long side is 1920 and the short side is 1080. The output short side remains unchanged at 360. The long side is calculated to be
1920x360/1080 = 640
Which means the output resolution will be 640x360. When the input stream is changed to 1080x1920 the output stream will be changed to 360x640. If the subsequent input stream is changed to 1080x720, the output stream will be changed to 540x360. Therefore, when we set long edge adaptation and set the output resolution to 960x360, the resolution change of the input stream is 1920x1080- > 1080x1920- > 1080x720, and the output resolution is 640x360- > 360x640- > 540x360.
If short edge adaptation is enabled and other conditions remain unchanged, the output resolution is 960x540- > 540x960- > 960x640.
If the enablePpuScaleAdapt parameter is enabled, the resolution of the PPU output is aligned downwards by 2 (by default). We do not recommend using this parameter. We recommend using scale0LongShortAdapt instead.
| Supported Values | - 0: set default disable PpuScaleAdapt - 1: set PpuScaleAdapt as adapt to long edge - 2: set PpuScaleAdapt as adapt to short edge |
| Default | 0 |
Scale0LongShortAdapt
This parameter is used to enable PPU scale0 long and short edge adaptation.
You can check the detailed usage instructions in Chapter 9.2.
| Supported Values | - 0: set default disable PpuScaleAdapt - 1: set PpuScaleAdapt as adapt to long edge - 2: set PpuScaleAdapt as adapt to short edge |
| Default | 0 |
Scale1LongShortAdapt
This parameter is used to enable PPU scale1 long and short edge adaptation.
You can check the detailed usage instructions in Chapter 9.2.
| Supported Values | - 0: set default disable PpuScale1Adapt - 1: set PpuScale1Adapt as adapt to long edge - 2: set PpuScale1Adapt as adapt to short edge |
| Default | 0 |
Scale2LongShortAdapt
This parameter is used to enable PPU scale2 long and short edge adaptation.
You can check the detailed usage instructions in Chapter 9.2.
| Supported Values | - 0: set default disable PpuScale2Adapt - 1: set PpuScale2Adapt as adapt to long edge - 2: set PpuScale2Adapt as adapt to short edge |
| Default | 0 |
Scale0ResCeil
This parameter sets the resolution of the ppu scale0 output to be rounded, and the input parameter must be an even number. For example, [2, 4, 8, 16].
| Supported Values | even number |
| Default | 2 |
Scale1ResCeil
This parameter sets the resolution of the ppu scale1 output to be rounded, and the input parameter must be an even number. For example, [2, 4, 8, 16].
| Supported Values | even number |
| Default | 2 |
Scale2ResCeil
This parameter sets the resolution of the ppu scale2 output to be rounded, and the input parameter must be an even number. For example, [2, 4, 8, 16].
| Supported Values | even number |
| Default | 2 |
Scale0Round
This parameter is used to set whether the resolution of the ppu scale0 is rounded up or down, with default rounding up.
Supported Values: [up, down]
Default: up
| Supported Values | - up - down |
| Default | up |
Scale1Round
This parameter is used to set whether the resolution of the ppu scale1 is rounded up or down, with default rounding up.
| Supported Values | - up - down |
| Default | up |
Scale2Round
This parameter is used to set whether the resolution of the ppu scale2 is rounded up or down, with default rounding up.
| Supported Values | - up - down |
| Default | up |
enablePpuScaleLimit
Enabling this parameter causes the output resolution of the PPU Scale to be compared to the input stream resolution. If the PPU Scale is upward then an error will be reported via exit.
For example, when the input stream is 720x360, and if the output resolution is 2560x1440, then the scaling will exit with an error.
If however, enablePpuScaleLimit=0 then it will not exit with an error, the smallest resolution between the input and output will be chosen as the actual output resolution.
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0 |
skipPtsGuess
When enable this parameter, it will pass through the decoder pts and skip guessing correct pts in libxcoder.
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0 |
minPacketsDelay
Specifies whether to enable the minimum decoding delay packets feature. When enabled, libxcoder increases its rate of polling the decoder and only permits buffering of the minimum packets to minimize the delay.
The minimum decoding delay packets is calculated according to the related bitstream header SPS/PPS/VPS. If enable this option in multi-core mode(multicoreJointMode), the decoding performance will decrease to non-multi-core mode level.
| Not Applicable | JPEG or VP9 |
| Supported Values | - 0: Disable - 1: Enable |
| Default | 0 |
enableFollowIFrame
If “-force_key_frame source” and “intraPeriod=0” are specified in the command line for transcoding, IDR frames are inserted at the same locations as in the source, excluding non-IDR I-frames. For more details, see Section 12.6, ‘IDR Frame Forcing.’
Setting enableFollowIFrame to 1 causes the decoder to mark both non-IDR and IDR I-frame locations in the source, enabling the encoder to insert IDR frames at these marked locations. The example command is shown below:
ffmpeg -c:v h264_ni_quadra_dec -xcoder-params enableFollowIFrame=1 -i input.264 -force_key_frames source -c:v h265_ni_quadra_enc -xcoder-params “intraPeriod=0:RcEnable=1:bitrate=7500000” output.265
Not Applicable: JPEG.
Supported Values:
0: Disable
1: Enable
Default: 0: Disable
| Not Applicable | |
| Supported Values | |
| Default |
disableAdaptiveBuffers
Specifies whether to disable adaptive buffers when bitstream sequence change. When disableAdaptiveBuffers=1 and width/height of pictures is different from previous width/height in sequence change, the picture buffers will re-allocate. It takes a little time to re-configure decoder and save memory space if width/height is from large to small.
Note – If this option is used and the output type of decoder is hw in transcoding
, the disableAdaptiveBuffers parameter of quadra encoder should be used at same time. If there are many sequence changes in customer’s bitstream, suggest to enable this parameter.
Not Applicable: JPEG or VP9.
Supported Values:
0: Disable
1: enable
Default: 0: Disable
| Not Applicable | |
| Supported Values | |
| Default |
surviveStreamErr
Specifies whether to treat unsupported or corrupted value in stream headers as non-fatal errors. When surviveStreamErr=1, if the decoder encounters an unsupported value in stream headers, the following frames would be dropped until the next supported header is received. Then the decoder will continue decoding the supported frames.
This feature is useful when decoding inputs that may suffer from random packet loss (e.g. livestream through UDP). It makes sure that the decoding process does not terminate when corruptions occur in the stream headers.
Not Applicable: JPEG.
Supported Values:
0: Disable
1: enable
Default: 0: Disable
| Not Applicable | |
| Supported Values | |
| Default |
reduceDpbDelay
Specifies whether to enable reduceDpbDelay mode for H264 bitstream. When reduceDpbDelay is equal to 1 and the flag bitstream_restriction_flag of vui_parameters is equal to 0 or reduceDpbDelay is equal to 1 and there is no vui_parameter, SW will get decoded picture after two packets are decoded in the decoding beginning. If FW found there is out of order picture, FW will increase the number of packets which need to be decoded and drop out of order picture.
Note – This feature is an 'experimental' feature with risks which may drop some out of order pictures and there may be frame skip in the decoding beginning. The feature will obviously decrease the delay of the first decoded picture, because in some cases, the delay of the first decoded picture is very big like 17.
Not Applicable: JPEG or VP9 or HEVC.
Supported Values:
0: Disable
1: enable
Default: 0: Disable
| Not Applicable | |
| Supported Values | |
| Default |
decoderMode
The decoderMode can be selected as “normal” or "intra_only" to process all frames or only I frame. By default, this parameter is Normal mode.
Note - Only applicable to H.264/HEVC.
Supported Values:
“normal”: All frames processing
"intra_only": I frame only processing
Default: “normal”
| Not Applicable | |
| Supported Values | |
| Default |
The following is a Quadra decoder example using the postprocessor to do the scaling. Since the cropping mode defaults to auto, any required cropping will be applied. For example, since the picture height for 1080p is not divisible by 16, it must be padded to 1088 before H.264 encoding thus the bitstream will contain cropping info to remove this padding back to a picture size of 1920x1080. The hwdownload filter will use our callback function to fetch the YUV data to write to the output file. The downloaded YUV will already be scaled and so will require less CPU to transfer it. If we do a transcode to a NETINT encoder, the YUV will not need downloading at all.
ffmpeg -y -c:v h264_ni_quadra_dec -dec 0 -xcoder-params "out=hw:scale0=1280x720:force8Bit0=1" -i inputs/h264/Marketplace_1920x1080p30_300_10bit.h264 -vf hwdownload,format=yuv420p -c:v rawvideo temp.yuv
Below is a Quadra decoder example using the postprocessor to do manual cropping. In this case we want to change the aspect ratio of the output from 16:9 to 4:3. This is accomplished by cropping the 1920x1088 decoded output to 1440x1080. We have started the cropping at x=240 and y=0 which removes 240 pixels from both the right and left sides of the picture and the bottom 8 bits of padding from the bottom of the picture. Since hw is not specified in this case we default to outputting a 10 bit software YUV frame.
ffmpeg -c:v h264_ni_quadra_dec -dec 0 -xcoder-params "cropMode0=manual:crop0=1440,1080,240,0" -i input1080p10bit.264 -c:v rawvideo output1440x1080-10bit.yuv