X264速率控制集

x264 rate control set

本文关键字:速率控制 X264      更新时间:2023-10-16

我已经学习x264编码好几个月了。我需要的是控制速率,得到一个平均比特率。以下是我的设置,我有一个平均比特率,但图像质量很差,所以我需要你的建议或一些可以帮助我了解更多关于x264的东西。

Params.rc.i_rc_method = X264_RC_ABR ;
Params.rc.i_bitrate = nBitRate*0.65/1000  ;
Params.rc.i_vbv_buffer_size = nBitRate/1000;
Params.rc.i_vbv_max_bitrate = nBitRate*0.65/1000 ;
Params.rc.f_vbv_buffer_init = 1.0 ;
Params.rc.f_rate_tolerance = 1.0 ;                              
Params.i_fps_num =  ParamIn.dFrameRate*0.6 ;
Params.i_fps_den = 1 ;
Params.i_width = ParamIn.nWidth ;
Params.i_height = ParamIn.nHeight ;

嗯,如果你的视频质量很差…你需要提高比特率。这是我使用的编码:-

x264 --preset fast --profile high --level 4.1 --tune animation --ref 10 --subme 9 --merange 32  --bitrate 500 --me umh --input-res 848x480 --trellis 2 --pass 1   -o Outvideo.mp4 input.mp4
x264 --preset fast --profile high --level 4.1 --tune animation --ref 10 --subme 9 --merange 32  --bitrate 330 --me umh --input-res 848x480 --trellis 2 --pass 2   -o Outvideo.mp4 input.mp4

好吧,我做2通过,因为它比1通过有很多原因,如果你正在做基于比特率的编码,2通过总是有帮助的!您可以使用"--bitrate x"选项来选择比特率。只要把" x "改成你想要的平均比特率。