0

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

我正在使用以下命令

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)。

他们的命令有问题吗。或者我必须使用其他参数?请提供您的建议,这非常重要。

4

1 回答 1

1

这些选项不会做你认为他们做的事情。来自FFmpeg 常见问题解答

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和其他设置不会像您想象的那样控制输出流速率。

于 2010-05-02T09:35:52.390 回答