Updated on 2022-03-13 GMT+08:00

RunVenc

Syntax

int32_t RunVenc(int32_t vencHandle, struct VencInMsg* vencInMsg)

Function

Controls the DVPP executor to implement video encoding. The RunVenc API is called by using the instance created by CreateVenc.

Input

int32_t handle and VencInMsg pointer. vencHandle is the return value of CreateVenc. For details about VencInMsg, see Input Parameter: VencInMsg. VencInMsg indicates the VENC executor configuration information. This structure is used to transfer the video information to be encoded to the executor for encoding.

Output

None

Return Value

  • 0: success
  • –1: failure

Instructions

The caller calls the RunVenc function to transfer the encoding instance, the VencInMsg object pointer, and the configured vencInMsg.

Restriction

To encode multiple images into a video, call RunVenc to encode the video by using the same instance after creating an instance by calling CreateVenc, and then call DestroyVenc to release the instance.

Input Parameter: VencInMsg

This input parameter is used when the VENC module is called to perform encoding. All member variables of the structure must be initialized before being used.

Table 1 Input parameter VencInMsg

Member Variable

Description

Value Range

void* inputData

Address of the input data

The value cannot be null.

uint32_t inputDataSize

Input data size

The value cannot be greater than the size of the input data buffer. The recommended value is the same as the size of the input data buffer.

uint32_t keyFrameInterval

I-frame interval

The value range is [0, 65535). The value 0 indicates that the parameter is invalid.

uint32_t forceIFrame

Whether to forcibly restart the I-frame interval. 0: No. 1: Yes.

The value is 0 or 1.

uint32_t eos

Whether the frame is an end frame. 0: No. 1: Yes.

The value is 0 or 1.

Output Parameter: VencOutMsg

Table 2 Output parameter VencOutMsg

Member Variable

Description

Value Range

void* outputData

Output data address

Applied by the VENC internally

uint32_t outputDataSize

Output data size

Configured by the VENC internally

uint32_t timeStamp

Timestamp of calling the callback function

Configured by the VENC internally