FFMPEG ignores bitrate

I'm new to video coding, so bear with me.

I am using FFMPEG. I have a mp4 file that is 640 x 350 with an average bitrate of about 2000 KB (I think) and a size of 80 MB. I want to convert this to an ogv file with a much lower transfer rate (128kb) but with 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 setting and output a file with a bitrate of about 600 KB and a size of about 3 MB.

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

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

... but I was wondering if FFMPEG can be used.

Any ideas?

Edit

mark4o solved my problem. It turns out that the default audio codec was gaining file size. Changing it in libvorbis significantly reduced the file size. The final team looks like

 ffmpeg -i input.mp4 -b:v 128k -b:a 128k -codec:a libvorbis output128.ogv 
  • -i = input file
  • -b:v = video stream bitrate
  • -b:a = audio stream bitrate
  • -codec:a = override default audio codec
+8
ffmpeg bitrate
source share
1 answer

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

Assuming you need vorbis sound, use the -codec:a libvorbis (or -acodec libvorbis in some versions) in front of the output file name to indicate this. You can also specify the bitrate for the sound, for example. -b:a 32k (or -ba 32k ). If you want the total data transfer rate to be 128 Kbps, specify the bitrates of audio and video, which are up to 128 thousand (or a little less if you want to compensate for the overhead costs of ogg).

+4
source share

All Articles