hi_mpi_venc_set_h265_vui
Applicability
Product |
Supported |
|---|---|
☓ |
|
☓ |
|
√ |
|
√ |
|
☓ |
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 video encoding. However, correction is recommended for decoders/players.
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. |
h265_vui |
Input |
VUI parameter of an H.265 encoding channel. |
Returns
- 0: success
- Other values: failure. For details, see VENC/JPEGE Return Codes.
Restrictions
- 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.
- It is recommended that this API be called after an encoding channel is created and before encoding is started. This can reduce the number of API calls 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 parameters in hi_venc_h265_vui are configurable. Other parameters are reserved and must be set to the default values. Otherwise, encoding fails. Before calling this API, you are advised to call hi_mpi_venc_get_h265_vui to obtain the default VUI configurations of the current encoding channel, so that errors in reserved parameters 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 set related parameters. Note that the display frame rate affects only the playback speed of the player. To control the 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 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. If the playback speed is 0.5x, the display frame rate is set to 15 FPS.
- The VUI parameters are optional. The final effect of parameter configuration (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.