2010-04-30 194 views
0

我正在处理关于比特率的一个非常大的问题,ffmpeg提供-b选项的比特率和调整它提供-minrate-maxrate,-bufsize,但它不正常工作。如果我在-b选项给256kbps,当转码完成时,它提供380kbps。我们如何使用ffmpeg来实现恒定比特率。如果他们是+ -10Kb它是可调整的。但视频比特率总是超过50-100kbps。FFmpeg比特率问题

我使用下面的命令

ffmpeg -i "demo.avs" -vcodec libx264 -s 320x240 -aspect 4:3 -r 15 -b 256kb \ 
    -minrate 200kb -maxrate 280kb -bufsize 256kb -acodec libmp3lame -ac 2 \ 
    -ar 22050 -ab 64kb -y "output.mp4" 

当转码完成后,媒体信息显示总比特率440KB(应该是320KB)。

他们的命令是否有问题。或者我必须使用其他参数? Plz提供你的建议非常重要。

回答

2

这些选项不会做你认为他们做的事。从FFmpeg FAQ

3.18 FFmpeg does not adhere to the -maxrate setting, some frames are bigger than 
    maxrate/fps. 

      Read the MPEG spec about video buffer verifier. 

3.19 I want CBR, but no matter what I do frame sizes differ. 

      You do not understand what CBR is, please read the MPEG spec. Read 
      about video buffer verifier and constant bitrate. The one sentence 
      summary is that there is a buffer and the input rate is constant, the 
      output can vary as needed. 

让我强调一个森泰斯你:

的一句话总结是,有一个缓冲区和输入速度是恒定的,因为所需的输出可以改变。

这意味着,本质上-maxrate和其他设置不像您认为的那样控制输出流速率。