hi_venc_h265_cbr
Description
Defines the CBR attributes of an H.265 encoding channel.
Prototype
hi_venc_h265_cbr = {"gop": gop,
"stats_time": stats_time,
"src_frame_rate": src_frame_rate,
"dst_frame_rate": dst_frame_rate,
"bit_rate": bit_rate}
Members
Member |
Description |
|---|---|
gop |
Int, group of pictures. A video sequence includes several temporal continuous pictures. When a video is encoded, the video sequence is divided into several small picture groups. This parameter refers to a quantity of frames in a picture group. The GOP structure supports only Normalp (the first frame is an I-frame and other frames are P-frames). Therefore, this parameter also indicates the I-frame interval. The default value is 65535. The encoding of the I-frame does not need to refer to the previous frame, and the encoding quality of the previous frame is not passed on. Therefore, a smaller value means better encoding quality. However, it is recommended that the value be greater than or equal to the frame rate because the I-frame has only intra-frame prediction blocks. In most scenarios, a certain number of P-frames (with inter-frame prediction blocks) are required to ensure encoding quality. Value range: [1, 65536] |
stats_time |
Int, CBR statistical time, in seconds. You are advised to set it to gop/dst_frame_rate. A longer statistical time indicates that the impact on bit rate adjustment exerted by the bit rate fluctuation of each picture frame is weaker, the bit rate is adjusted more slowly, and the picture quality fluctuation is slighter. Value range: [1, 60] |
src_frame_rate |
Int, input frame rate, in FPS, that is, the number of frames that enter the encoder per second. The default value is 30. If the bit rate is fixed, a smaller frame rate indicates better encoding quality. However, a bit rate less than 25 can lead to discontinuous frames during playback. Value range: [1, 240] |
dst_frame_rate |
Int, output frame rate, in FPS, that is, the number of frames that exit the encoder per second. The default value is 30. If the bit rate is fixed, a smaller frame rate indicates better encoding quality. However, a bit rate less than 25 can lead to discontinuous frames during playback. Value range: [1, src_frame_rate] A fractional frame rate is not supported currently. |
bit_rate |
Int, average output bit rate of the encoder, in kbit/s. A larger value indicates better encoding quality. The default value is 2000. Value range: [2, 614400]. The average bit rate is related to the width and height of the encoding channel and the image frame rate. Table 1 lists the typical settings of the average bit rate, with the assumption that the full encoding frame rate (30 FPS) is reached. If the encoding output frame rate is not set to the full frame rate, you can calculate the actual bit rate by the proportion of the configured frame rate to the full frame rate (30 FPS). |