[FFmpeg-user] libopus encoder produces bigger files than opusenc with 6-channel audio

Peter White peter.white at posteo.net
Mon Jul 18 20:39:31 EEST 2016


Am 18.07.2016 um 18:56 schrieb Carl Eugen Hoyos:
  > Peter White <peter.white <at> posteo.net> writes:
  >
  >> For 6-channel audio the "target" bitrate is 320 kbit/s
  >> in both applications.
  >
  > From a (very) quick look at the source, I don't think this
  > is correct but it doesn't matter because defaults may
  > change.

That is not my point. And it is 320 kbit/s for 6-channel, at least
that's what the output of libopus in ffmpeg says:

[libopus @ 0x3b09320] No bit rate set. Defaulting to 320000 bps.

  > Note that you should not assume FFmpeg plus
  > external library behaves like external library plus raw
  > input.

My point is that if the settings and the input are the same then the
outcome should be the same for ffmpeg and opusenc. Both link against
the same libopus if I understand correctly.
But apparently my assumption of the same defaults was incorrect.
ffmpeg disables surround masking and LFE bandwidth optimizations by
default (-mapping_family -1). Setting -mapping_family to 1 now results
in the same bitrate as opusenc produces.
But I used n3.1.1 for my initial tests, which does not have that
option, so I am sorry for not having checked with the current master,
which I now did.

Now, the reason I did not set a bitrate explicitly is that I wanted a
kind of poor man's constant quality mode in my encoding shell script.
It is intended for a range of inputs, which could be mono, stereo or
multichannel audio. I would rather like to avoid checking for number
of channels and have special cases for different bitrates just because
the number of channels is different.

But thank you very much for your input and effort.

Best,
Peter


More information about the ffmpeg-user mailing list