ffmpeg码率配置

官网摘要如下:

The range of the CRF scale is 0–51, where 0 is lossless, 23 is the default, and 51 is worst quality possible. A lower value generally leads to higher quality, and a subjectively sane range is 17–28. Consider 17 or 18 to be visually lossless or nearly so; it should look the same or nearly the same as the input but it isn't technically lossless.
    The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate.
    Choose the highest CRF value that still provides an acceptable quality. If the output looks good, then try a higher value. If it looks bad, choose a lower value.
    -crf 29 -preset slower -tune help
    -c:v libx264 -preset ultrafast -crf 0
    -profile baseline/main/high/hgin10/hgin422/high444

实验使用命令:

-crf 25 -c:v libx264 -profile:v main -preset:v fast -level 3.1 // ?
-crf 23 -c:v libx264 -profile:v main -preset:v fast -level 3.1 
    
  // ffmpeg -i input.mp4 -c:v libx264 -x264-params "nal-hrd=cbr" -b:v 1M -minrate 1M -maxrate 1M -bufsize 2M output.ts
 -b:v 2M -minrate 2M -maxrate 3M -bufsize 5M

总结:

-b:v 限定最小最大值缓冲,未设置profile,level,清晰度会一定程度影响。

crf +-参数 会翻倍降码率,但数值与码率非线性关联。

转码会消耗一定cpu。

必读索引:

http://www.lighterra.com/papers/videoencodingh264/

https://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate

 

 

 

你可能感兴趣的:(ffmpeg码率配置)