FFmpeg 比特率问题

发布于 2024-08-31 05:51:59 字数 582 浏览 5 评论 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)。

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

I'm dealing with a very big issue about bit rate , ffmpeg provide the -b option for the bit rate and for adjustment it provide -minrate and -maxrate, -bufsize but it don't work proper. If i'm giving 256kbps at -b option , when the trans-coding finishes , it provide the 380kbps. How can we achieve the constant bit rate using ffmpeg. If their is +-10Kb it's adjustable. but the video bit rate always exceed by 50-100 kbps.

I'm using following command

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"

When trans-coding is done, the Media Info show overall bit rate 440kb (it should be 320kb).

Is their something wrong in the command. Or i have to use some other parameter? Plz provide your suggestion its very important.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗地喜欢 2024-09-07 05:51:59

这些选项的作用并不如您想象的那样。来自 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等设置不要像您想象的那样控制输出流速率。

Those options don't do what you think they do. From the 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.

Let me highlight a sentance for you:

The one sentence summary is that there is a buffer and the input rate is constant, the output can vary as needed.

That means, in essence that the -maxrate and other settings don't control the output stream rate like you thought they did.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文