[FFmpeg-user] -b:a doesn't give me desired output bitrate

Shriramana Sharma samjnaa at gmail.com
Wed Jul 5 04:41:34 EEST 2017


Hello. I'm trying to concatenate two OPUS audio files (from WhatsApp)
into an MP3.

On my first try without specifying output bitrate I found that the MP3
file is far too big (10 MB) than the sum of the input OPUS files (1
and 2 MBs). Then I figured it was because of the output bit rate not
being set. But even with using -b:a to set the bitrate to the same as
the input, I find that for some reason the output seems to use a
higher bitrate and the output is still bigger than the sum of its
inputs.

Please guide me as to how I can get my desired effect of getting an
output MP3 file that is comparable in size to the sum of its input
OPUS files.

$ ffmpeg -f concat -safe 0 -i <(printf "file '$PWD/%s'\n" *.opus) -b:a
18k -c libmp3lame output.mp3
Input #0, concat, from '/dev/fd/63':
  Duration: N/A, start: -0.002167, bitrate: N/A
    Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
Stream mapping:
  Stream #0:0 -> #0:0 (opus (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'output.mp3':
  Metadata:
    TSSE            : Lavf57.71.100
    Stream #0:0: Audio: mp3 (libmp3lame), 48000 Hz, mono, fltp, 18 kb/s
    Metadata:
      encoder         : Lavc57.89.100 libmp3lame
size=    5319kB time=00:22:41.61 bitrate=  32.0kbits/s speed= 103x
video:0kB audio:5319kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.004351%

$ for x in *.opus output.mp3 ; do ffprobe $x ; done
Input #0, ogg, from 'AUD-20170705-WA0000.opus':
  Duration: 00:07:41.82, start: 0.002167, bitrate: 18 kb/s
    Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
Input #0, ogg, from 'AUD-20170705-WA0001.opus':
  Duration: 00:14:59.78, start: 0.002167, bitrate: 18 kb/s
    Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
Input #0, mp3, from 'output.mp3':
  Metadata:
    encoder         : Lavf57.71.100
  Duration: 00:22:41.64, start: 0.023021, bitrate: 32 kb/s
    Stream #0:0: Audio: mp3, 48000 Hz, mono, s16p, 32 kb/s
$ ls -l *.opus output.mp3
1096672 Jul  5 06:30 AUD-20170705-WA0000.opus
2124414 Jul  5 06:30 AUD-20170705-WA0001.opus
5446797 Jul  5 07:01 output.mp3

-- 
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा


More information about the ffmpeg-user mailing list