Function: venc_send_frame

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

x

Atlas A2 training products / Atlas A2 inference products

x

Atlas training products

x

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Feeds images to the encoder for encoding. This API is asynchronous.

Prototype

  • C Prototype
    1
    aclErroraclvencSendFrame(aclvencChannelDesc *channelDesc,acldvppPicDesc *input,void *reserve,aclvencFrameConfig *config,void *userdata)
    
  • Python Function
    1
    ret = acl.media.venc_send_frame(venc_channel_desc, input, reserve, config, userdata)
    

Parameter Description

Parameter

Description

venc_channel_desc

Int, pointer address of a specified channel.

Must be the same as channelDesc passed to the acl.media.venc_create_channel call.

Specify the video encoding callback function in the channel description.

input

Int, pointer address of the input image description. You need to allocate the input buffer in advance.

  • Create image description by calling acl.media.dvpp_create_pic_desc, and set image description parameters (such as the image format, width, and height) by calling acl.media.dvpp_set_pic_desc.

    The input image format is subject to the format set in the channel description. The acl.media.dvpp_set_pic_desc_format call to set the input image format is invalid.

  • For details about the input resolution and format restrictions, see Functions and Restrictions.

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 Description

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.
  • The channel passed to this call must have been created. Otherwise, an error code is returned.
  • It is not supported to feed empty packets with eos set to 0 (the stream length is 0 or the stream address is empty).
  • When an empty image with eos set to 1 is sent, the current encoding ends.

Reference

For details about the API call sequence and example, see VENC.