简体   繁体   中英

x264 rate control set

I have been learning x264 encode for months. What I need is to control the rate and get an average bitrate. Following is my set, I got an average bitrate but the picture quality is bad, so I need your suggestion or something that can help me learn more about 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 ;

Well, if the quality of your video is bad... you need to increase the bitrate. This is what I use for my encodes :-

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

well, I do 2 pass, because it's better than 1 pass for many reasons and if you are doing BIT-RATE based encodes, 2 pass always helps! You can select the bit-rate by using the " --bitrate x " option. Just change " x " with the average bitrate you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM