venc_set_h265_vui
Applicability
Product |
Supported (√/x) |
|---|---|
x |
|
x |
|
x |
|
√ |
|
√ |
Function Usage
Sets the VUI parameters of an H.265 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
- C Prototype
1hi_s32 hi_mpi_venc_set_h265_vui(hi_venc_chn chn, const hi_venc_h265_vui *h265_vui)
- Python Function
1ret = acl.himpi.venc_set_h265_vui(chn, h265_vui)
Parameter Description
Parameter |
Description |
|---|---|
chn |
Int, encoding channel ID.
|
h265_vui |
Dict, dictionary of VUI attributes of an H.265 encoding channel. For details, see hi_venc_h265_vui. |
Return Value Description
Return Value |
Description |
|---|---|
ret |
Int, error code.
|
Restrictions
- This API is used to set the VUI parameters of an H.265 encoding channel.
- Call this API 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.
- You are advised to call this MPI after creating a channel but before starting encoding. This reduces the number of times of calling this MPI during encoding.
- Call this API only in an H.265 encoding channel.
- Currently, only the hi_venc_vui_video_signal and hi_venc_vui_h265_time_info attributes in hi_venc_h265_vui is available for users to configure. Other attributes are reserved and must be set to the default values. Otherwise, encoding fails. It is recommended that acl.himpi.venc_get_h265_vui be called before this API to obtain the default VUI configurations of the current encoding channel, so that errors in reserved attributes can be avoided.
- 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 configure 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 attribute in acl.himpi.venc_create_chn.
You are advised to set the control frame rate to be the same as the display frame rate. Otherwise, the playback bit rate may be different from the configured encoding bit rate. 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.