venc_create_chn
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
√ |
|
|
√ |
|
|
√ |
|
|
x |
|
|
√ |
|
|
√ |
Description
Creates an encoding channel.
Prototype
- C Prototype
1hi_s32 hi_mpi_venc_create_chn(hi_venc_chn chn, const hi_venc_chn_attr *attr)
- Python Function
1ret = acl.himpi.venc_create_chn(chn, attr)
Parameters
|
Parameter |
Description |
|---|---|
|
chn |
Int, decoding channel ID.
NOTE:
For Ascend virtual instances on the For Ascend virtual instances on the For Ascend virtual instances on the To view the computing power specifications of Ascend virtual instances in different scenarios, run the npu-smi info -t template-info command on the server where AI processor is installed. |
|
attr |
Dict, dictionary of encoding channel attributes. For details, see hi_venc_chn_attr. |
Return Value
|
Return Value |
Description |
|---|---|
|
ret |
Int, error code.
|
Restrictions
- The channel ID of a single device must not be greater than the maximum channel ID.
- An encoding channel has the encoder attributes, RC attributes, and group of pictures (GOP) attributes.
- For the encoder attributes, you must set the parameters such as the encoding stream buffer depth, stream obtaining mode, and encoding profile. The Table 1 describes the features of each attribute of each protocol.
- The recommended encoding sizes are 3840 x 2160 (4K), 1920 x 1080 (1080p), and 1280 x 720 (720p).
- For H.264/H.265 encoding, a frame buffer consists of YHeaderSize, CHeaderSize, YSize, CSize, PmeSize, PmeInfoSize, and TmvSize. The encoder calculates the buffer allocation based on the maximum width and height by default. When configuring the channel width and height, ensure that each frame buffer calculated based on the channel width and height is within that calculated based on the maximum channel width and height.
- The input/output frame rate (src_frame_rate/dst_frame_rate) in the attributes of the bit rate controller is used to allocate the bit rate (bit_rate) during encoding, but not the final display frame rate of the player. For details about how to set the display frame rate, see acl.himpi.venc_set_h264_vui or acl.himpi.venc_set_h265_vui.
You are advised to set the control frame rate to be the same as the display frame rate. Otherwise, the bit rate during playback may be different from the encoding bit rate configured by the user, and the playback bit rate will vary with the configured display frame rate.
References
|
Encode Protocol |
Encode Mode |
Stream Buffer Depth |
Stream Fetching Mode |
Encode Profile |
|---|---|---|---|---|
|
H.264 |
Frame |
|
Frame/Slice |
Baseline Main Profile High Profile |
|
JPEG |
Frame |
|
Frame/Ecs |
Baseline |
|
H.265 |
Frame |
|
Frame/Slice |
Main Profile Main 10 Profile (not supported currently) |
|
Frame/Slice |
Main 10 profile (not supported currently) |