VencConfig

Function

A struct used to encode videos.

Structure Definition

struct VencConfig {
    uint32_t width = 0;
    uint32_t height = 0;
    MxbaseStreamFormat outputVideoFormat = MXBASE_STREAM_FORMAT_H264_MAIN_LEVEL;
    MxbasePixelFormat inputImageFormat = MXBASE_PIXEL_FORMAT_YUV_SEMIPLANAR_420;
    uint32_t keyFrameInterval = 30;
    uint32_t deviceId  = 0;                                                    
    pthread_t encoderThreadId = 0;
    bool stopEncoderThread = false;
    uint32_t srcRate = 0;
    uint32_t rcMode = 0;
    uint32_t maxBitRate = 0;
    uint32_t ipProp = 0;
    std::function<void(std::shared_ptr<uint8_t>, uint32_t)>* userData;
};

Parameter Description

Parameter

Input/Output

Description

width

Input

Input width

height

Input

Input height

outputVideoFormat

Input

Output stream format

inputImageFormat

Input

Input image format

keyFrameInterval

Input

I-frame interval

deviceId

Input

Device ID

encoderThreadId

Input

ID of a callback thread

stopEncoderThread

Input

Whether the callback thread is running

srcRate

Input

Frame rate of the input stream (fps)

rcMode

Input

Bit rate control mode

maxBitRate

Input

Output bit rate (kbit/s)

ipProp

Input

I-frame to P-frame bit allocation ratio within a GOP

userData

Input

Customized data.