FFMPEG ignores bitrate

前提是你 提交于 2021-01-26 04:28:54

问题


I am new to video encoding so bear with me.

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

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

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

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

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

Any ideas?

Edit

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 = 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

回答1:


-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.

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



来源:https://stackoverflow.com/questions/10604534/ffmpeg-ignores-bitrate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!