VideoDecodeConfig

Function

Stores video decoding parameters.

Structure Definition

struct VideoDecodeConfig {
    uint32_t width = 1920;
    uint32_t height = 1080;
    StreamFormat inputVideoFormat = StreamFormat::H264_MAIN_LEVEL;
    ImageFormat outputImageFormat = ImageFormat::YUV_SP_420;
    VideoDecodeCallBack callbackFunc = nullptr;
    uint32_t skipInterval = 0;
};

Parameter Description

Parameter

Description

width

Width of video decoding buffer. The value ranges from 128 to 4096 and defaults to 1920, which must be an even number of a multiple of 16.

Set this parameter based on the actual video frame data. The value must be greater than or equal to the actual video frame data width. Otherwise, no decoding output is available. If the value is too large, redundant memory resources are generated.

height

Height of the video decoding buffer. The value must be an even number, which ranges from 128 to 4096 and defaults to 1080.

Set this parameter based on the actual video frame data. The value must be greater than or equal to the actual video frame data height. Otherwise, no decoding output is available. If the value is too large, redundant memory resources are generated.

inputVideoFormat

Input video format.

H.264 videos support the h264_baseline_level, h264_main_level, and h264_high_level formats. H.265 videos support only the h265_main_level format. The default value is StreamFormat::H264_MAIN_LEVEL.

outputImageFormat

Output image format after decoding.

For the Atlas 200/300/500 inference product, YUV_SP_420 and YVU_SP_420 are supported.

For the Atlas inference products, YUV_SP_420 (default), YVU_SP_420, RGB_888, and BGR_888 are supported.

callbackFunc

Callback function after decoding. It cannot be a null pointer.

skipInterval

Skipped frames during video decoding. The value ranges from 0 to 250 and defaults to 0.