CreateVenc
Syntax |
int32_t CreateVenc(struct VencConfig* vencConfig) |
---|---|
Function |
Obtains the VENC instance, which is equivalent to obtaining the handle of the VENC executor. The caller can call RunVenc to encode images by using the obtained VENC instance. |
Input |
Pointer to the VencConfig structure. For details about the VencConfig structure, see Input parameter: VencConfig. You need to configure a callback function to process the encoding result. |
Output |
None |
Return Value |
|
Instructions |
The caller creates the VencConfig object pointer. The VencConfig object pointer is passed by calling the CreateVenc function. If the application is successful, CreateVenc returns the handle to the VENC instance. Otherwise, –1 is returned. The caller needs to verify the return value. |
Restriction |
The caller is responsible for the life cycle of the VENC instance, including the application and release, which are implemented by using CreateVenc and DestroyVenc, respectively. |
Input parameter: VencConfig
This input parameter is used when the VENC module is initialized. All member variables of the data structure must be initialized before being used.
Member Variable |
Description |
Value Range |
---|---|---|
uint32_t width |
Image width |
The value is an even number ranging from 128 to 1920. |
uint32_t height |
Image height |
The value is an even number ranging from 128 to 1920. |
uint32_t codingType |
Video encoding protocols |
0–3
|
uint32_t yuvStoreType |
YUV image storage format |
The value is 0 or 1.
|
uint32_t keyFrameInterval |
I-frame interval |
The value range is (0, 65535). |
VencOutMsgCallBack vencOutMsgCallBack |
Callback function, which is used to process the encoding result. When encoding each channel of image data, DVPP (the VENC module) calls the callback function twice for the first frame of image data. The first call is used to process the file header information, and the second call is used to process the image data of the current frame. |
typedef void (*VencOutMsgCallBack)(struct VencOutMsg* vencOutMsg, void* userData). The value cannot be null. |
void* userData |
The user records the information to be passed. The data is returned to the user in the callback function. |
The value can be NULL. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot