h264编码速度质量参数设置
来源:互联网 发布:19s管理淘宝 编辑:程序博客网 时间:2024/06/06 05:47
FFmpeg and x264 Encoding Guide 参数说明:http://ffmpeg.org/trac/ffmpeg/wiki/x264EncodingGuide
preset 与编码速度和质量相关
av_opt_set(c->priv_data, “preset”, “slow”, 0); Current presets in descending order of speed are: ultrafast,superfast, veryfast, faster, fast, medium, slow, slower, veryslow,placebo.
priv_data 属于每个编码器特有的设置域,用av_opt_set 设置
2014/5/29 :今天发现 av_opt_set(enc_ctx->priv_data, “preset”, “slow”, 0); slow的编码质量比medium(默认值)好多了。
固定码率150K,设置slow时:编码速度:245 fps 4ms
[libx264 @ 014bbb40] frame I:38 Avg QP:33.69 size: 3763
[libx264 @ 014bbb40] frame P:262 Avg QP:35.79 size: 381
meidum 时:编码速度:335 fps 2ms,
[libx264 @ 018dbb40] frame I:38 Avg QP:34.33 size: 3234
[libx264 @ 018dbb40] frame P:262 Avg QP:37.83 size: 455
veryslow 时:编码速度:140 fps 7ms
[libx264 @ 0187cb40] frame I:38 Avg QP:35.10 size: 3582
[libx264 @ 0187cb40] frame P:262 Avg QP:37.24 size: 405
如何设置固定码率编码
CBR (Constant Bit Rate)
There is no native CBR mode, but you can “simulate” a constant bit rate setting by tuning the parameters of ABR, like
ffmpeg -i input -c:v libx264 -b:v 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
in this example, -bufsize is the “rate control buffer” so it will enforce your requested “average” (4000k in this case) across each 1835k worth of video. So basically it is assumed that the receiver/end player will buffer that much data so it’s ok to fluctuate within that much.
Of course, if it’s all just empty/black frames then it will still serve less than that many bits/s (but it will raise the quality level as much as it can, up to the crf level).
只设置bit_rate是平均码率,不一定能控制住
c->bit_rate = 400000;
c->rc_max_rate = 400000;
c->rc_min_rate = 400000;
提示 [libx264 @ 00c70be0] VBV maxrate specified, but no bufsize, ignored
再设置 c->rc_buffer_size = 200000; 即可。
如此控制后编码质量明显差了。。。
- h264编码速度质量参数设置
- h264编码速度质量参数设置
- preset 与编码速度和质量相关
- H264--4--H264编码
- H264--4--H264编码
- H264--H264编码--4
- H264--H264编码--4
- H264--4--H264编码
- H264--4--H264编码
- H264--H264编码--4
- H264编码
- H264编码
- 编码质量
- x264编码参数设置
- AVC/H264编码教程
- AVC/H264编码教程
- AVC/H264编码教程
- S3C6410 MFC H264 编码
- 学习Linux命令(32)
- Turing Tree(线段树区间不同数字)
- LeetCode 100. Same Tree
- 损失函数减肥用,神经网络调权重(深度学习入门系列之六)
- acm_step1.1.6 1.1.7 1.1.8
- h264编码速度质量参数设置
- 使用maven构建多模块项目(二)
- 1-python 变量篇
- 整理一些Python—matplotlib和numpy会常用到的网站
- Intellij IDEA 快捷键
- hibernate笔记-013-多对多双向映射
- Thinking in java-20 Java 初始化
- 什么是Ajax? 详解原生js ajax
- CUDA小记(2)运行第一个CUDA程序