昇腾社区首页
中文
注册

VencConfig

功能

视频编码结构体。

结构定义

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;
};

参数说明

参数名

输入/输出

说明

width

输入

输入宽度。

height

输入

输入高度。

outputVideoFormat

输入

输出码流格式。

inputImageFormat

输入

输入图片格式。

keyFrameInterval

输入

I帧间隔。

deviceId

输入

设备编号。

encoderThreadId

输入

回调线程编号。

stopEncoderThread

输入

回调线程是否在运行的标记位。

srcRate

输入

输入码流帧率,单位fps。

rcMode

输入

指定码率控制模式。

maxBitRate

输入

输出码率,单位kbps。

ipProp

输入

一个GOP内单个I帧bit数和单个P帧bit数的比例。

userData

输入

用户自定义数据。