c++ - x264码率控制集

标签 c++ ffmpeg x264

我已经学习 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”更改为您想要的平均比特率即可。

关于c++ - x264码率控制集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16997546/

相关文章:

c++ - 为什么要重载以前未定义的运算符?

c++ - OpenGL 统一缓冲对象(数组)跳过其他 Vec2

ffmpeg - 在 ffmpeg 中处理多声道音频时忽略 "channel_layout"

ffmpeg - x264 无法使用 MacPorts 构建

c# - 有人使用 CLI 后端为 gcc 编译器编译 lib x264 吗?

c++ - FD_CLOSE 事件处理器 C++

c++ - Luabridge 中出现 "addProperty"错误

FFMPEG 图像到视频的反向序列与其他过滤器

linux - 使用 ffmpeg 将视频转换为 MP4 (H.264/AAC)

android - avcodec_find_encoder(AV_CODEC_ID_H264) 返回 null