Function: venc_send_frame
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
x |
|
|
x |
|
|
x |
|
|
x |
|
|
√ |
|
|
√ |
Description
Sends an image to the encoder for encoding. This API is asynchronous.
Prototype
- C Prototype
1aclErroraclvencSendFrame(aclvencChannelDesc *channelDesc,acldvppPicDesc *input,void *reserve,aclvencFrameConfig *config,void *userdata)
- Python Function
1ret = acl.media.venc_send_frame(venc_channel_desc, input, reserve, config, userdata)
Parameters
|
Parameter |
Description |
|---|---|
|
venc_channel_desc |
Int, pointer address of a specified channel. The value must be the same as that of channelDesc specified when the acl.media.venc_create_channel API is called to create a channel. The callback function for video encoding is specified in channel description. |
|
input |
Int, pointer address of the input image description. You need to allocate the input buffer in advance.
|
|
reserve |
Int, reserved parameter. It is set to 0. |
|
config |
Int, pointer address of the configuration data of a single frame. |
|
userdata |
Python object, user-defined data. |
Return Value
|
Return Value |
Description |
|---|---|
|
ret |
Int, error code. 0 on success; else, failure. |
Restrictions
- This API is asynchronous. The API call delivers a task rather than executes a task. After this API is called, call the synchronization API (for example, acl.rt.synchronize_stream) to ensure that the task is complete.
- Before sending data, ensure that a channel is created. Otherwise, an error code is returned.
- It is not allowed to send an empty stream packet with eos = 0 (stream length is 0 or stream address is empty).
- When an empty image with EOS = 1 is sent, the current encoding ends.