[视频]ffmpeg转码H.264
使用ffmpeg转码H.264视频:
参考帖子:
最终我得出的最精简配置是:
ffmpeg -i 我的视频.ogv -subq 9 -me_range 32 -g 250 -i_qfactor 1.3 -b_qfactor 1.4 test.m4v
(省略了-vcodec libx264,因为使用m4v自动就这样了,如果使用其他的扩展名,就要手动指定这个参数,如mkv扩展名)
ps我目前使用的最佳(清晰、高压缩、超级速度)转换命令:
- bufsize 影响速度
- cqp 影响质量 0-31,越小最终文件越小
- coder(0,1) 设置1启用cabac算法
- refs:参考帧,缺省6,越小文件越小
ffmpeg -i 我的视频.ogv -threads 2 -bufsize 700000k -vcodec libx264 -cqp 28 -coder 1 -refs 3 -me_method umh -subq 9 -me_range 32 -g 250 -i_qfactor 1.3 -b_qfactor 1.4 我的视频.mkv
我测试了,加上coder和refs后对压缩的共享还是比较少的。
各个参数含义:
- -subq 1-9 default 6
- -me_range 32
ForHEXandDIA,thisisclampedtobetween4and16,withadefaultof16.
For UMH and ESA, it can be increased beyond the default 16 to allow for a wider-range motion search, which is useful on HD footage and for high-motion footage. Note that for UMH and ESA, increasing MErange will significantly slow down encoding. - -g==>-keyint default 250 (1-250)
- -i_qfactor 1.3 Qscale difference between I-frames and P-frames.
- -b_qfactor 1.4 Qscale difference between P-frames and B-frames.
相关推荐
83096129 2020-01-08
ShoppingChen 2020-05-29
PGzxc 2020-03-27
chancle 2020-02-22
ShoppingChen 2020-02-22
ShoppingChen 2020-02-19
83096129 2020-02-15
cherayliu 2020-02-14
PGzxc 2019-12-30
yuuuuy 2019-12-30
dingwun 2020-11-16
wangdaren 2020-08-15
wqiaofujiang 2020-07-05
PGzxc 2020-07-04
ShoppingChen 2020-06-25
cherayliu 2020-06-17