hi_mpi_venc_set_h265_vui

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Description

Sets the VUI parameters of an H.265 encoding channel.

The VUI parameters mainly include the format information of the decoded image, such as the sampling aspect ratio, photoelectric conversion, and color space. The VUI parameters are optional in the protocol and do not affect the video encoding process. However, it is recommended that the decoder/player perform correction.

Prototype

hi_s32 hi_mpi_venc_set_h265_vui(hi_venc_chn chn, const hi_venc_h265_vui *h265_vui)

Parameters

Parameter

Input/Output

Description

chn

Input

Encoding channel ID.

Atlas 200I/500 A2 inference product: The value range of this parameter is [0, 128). The JPEGE, and VENC functions share the same channels, and the maximum number of channels is 128.

For the Atlas inference product, the value range of the encoding channel ID is [0, 256). The JPEGE and VENC functions share channels. The maximum number of channels is 256.

h265_vui

Input

VUI parameter of an H.265 encoding channel.

Returns

Restrictions

  • This API must be called after an encoding channel is created and before the channel is destroyed. If this API is called during encoding, the configuration takes effect only after the next I-frame is encoded.
  • It is recommended that this API be called after an encoding channel is created and before encoding is started, to reduce the number of the API calls during encoding.
  • It is recommended that this API be called only in an H.265 encoding channel.
  • Currently, only the hi_venc_vui_video_signal and hi_venc_vui_h265_time_info parameters in hi_venc_h265_vui are available for users to set. Other parameters are reserved and must be set to the default values. Otherwise, encoding fails. You are advised to call hi_mpi_venc_get_h265_vui to obtain the default VUI configurations of the current encoding channel before calling this MPI to avoid errors in reserved parameters.
  • hi_venc_vui_h265_time_info contains clock counting parameters that are not effective by default. To control the display frame rate, you need to set related parameters. Note that the display frame rate affects only the playback speed of the player. To control the bit rate control frame rate during encoding, you need to set the hi_venc_rc_attr parameter in hi_mpi_venc_create_chn.

    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 set by the user, and the playback bit rate will vary with the configured display frame rate.

    If you want to adjust the playback speed, you are advised to adjust the display frame rate within a proper range. Generally, the normal video playback speed is 30 FPS, indicating that the display frame rate is 30 FPS. If the display frame rate is increased, the playback speed increases. For example, if the playback speed is 3x, the display frame rate is set to 90 FPS. If the display frame rate is decreased, the playback speed decreases. For example, if the playback speed is 0.5x, the display frame rate is set to 15 FPS.

  • The VUI parameter is optional. The final effect of setting parameters (such as the display frame rate and pixel value range) by calling this API depends on the decoder/player behavior or user-defined decoding/playback behavior.