FFMPEG忽略比特率 [英] FFMPEG ignores bitrate

查看:104
本文介绍了FFMPEG忽略比特率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是视频编码的新手,请多多包涵.

I am new to video encoding so bear with me.

我正在使用FFMPEG.我有一个640 x 350的mp4文件,平均比特率约为2000kb(我认为),文件大小为80Mb.我想将其转换为具有低得多的比特率(128kb)但宽度和高度相同的ogv文件.我正在使用以下命令...

I am using FFMPEG. I have an mp4 file which is 640 x 350 with an average bitrate of around 2000kb (I think) and a filesize of 80Mb. I want to convert this to an ogv file with a much lower bit rate (128kb) but the same width and height. I am using the following command...

ffmpeg -i input.mp4 -b:v 128k output.ogv

...但是FFMPEG似乎忽略了我的比特率选项,并输出了一个比特率约为600kb且文件大小约为3Mb的文件.

... but FFMPEG seems to ignore my bitrate option and outputs a file with a bitrate of around 600kb and a filesize of around 3Mb.

我可以使用以下命令使用FFMPEG2THEORA做到这一点...

I can do this using FFMPEG2THEORA using the following command ...

ffmpeg2theora -V 128 input.mp4 -o output.ogv

...但是我想知道是否可以使用FFMPEG.

...but I was wondering if it was possible using FFMPEG.

有什么想法吗?

mark4o解决了我的问题.事实证明,默认音频编解码器提高了文件大小.将其更改为libvorbis极大地减小了文件大小.最终命令看起来像

mark4o solved my problem. It turns out that the default audio codec was bumping up the filesize. Changing it to libvorbis has reduced the filesize dramatically. Final command looks like

ffmpeg -i input.mp4 -b:v 128k -b:a 128k -codec:a libvorbis output128.ogv

  • -i =输入文件
  • -b:v =视频流的比特率
  • -b:a =音频流的比特率
  • -codec:a =覆盖默认音频编解码器
    • -i = input file
    • -b:v = the bitrate of the video stream
    • -b:a = the bitrate of the audio stream
    • -codec:a = override the default audio codec
    • 推荐答案

      -b:v 仅影响视频比特率.由于某些原因, ffmpeg 默认将flac音频编解码器用于 .ogv 输出(至少在某些版本中).在这种情况下,flac音频将比您的视频更大.

      -b:v only affects the video bitrate. For some reason ffmpeg defaults to using the flac audio codec for .ogv output (at least in some versions). In this case the flac audio will be even larger than your video.

      假设您想使用vorbis音频,请在输出文件名之前使用选项 -codec:a libvorbis (或在某些版本中为 -acodec libvorbis )来指定此选项.您可能还需要指定音频的比特率,例如 -b:a 32k (或 -ba 32k ).如果希望比特率为128kbps,则指定音频和视频比特率之和为128k(如果要补偿ogg容器的开销则要少一些).

      Assuming you wanted vorbis audio, use the option -codec:a libvorbis (or -acodec libvorbis in some versions) before the output file name to specify this. You may also want to specify a bitrate for the audio, e.g. -b:a 32k (or -ba 32k). If you want the total bitrate to be 128kbps, specify audio and video bitrates that add up to a total of 128k (or a little less if you want to compensate for the ogg container overhead).

      这篇关于FFMPEG忽略比特率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆