Function: venc_send_frame

Applicable Products

Product

Supported (√/x)

Ascend 950PR&950DT products

x

Atlas A3 products

x

Atlas A2 products

x

Atlas training products

x

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

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

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)
    

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 acl.media.venc_create_channel 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 Values

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Constraints

  • 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 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 set to 1 is sent, the current encoding ends.

Reference

For the API call sequence and examples, see VENC.