[FFmpeg-user] ffmpeg convert mp3 to opus codec (contained in ogg format)?

Moritz Barsnick barsnick at gmx.net
Thu Jul 18 17:27:47 EEST 2019


On Thu, Jul 18, 2019 at 15:23:32 +0200, Robert Keir wrote:
> I need to convert with the following settings:
>
> Bitrate of 19.1kbps
> 1 channel
> Sample rate of 16.0khz
>
> How would that look in:
>
> ffmpeg -i audio.mp3 -c:a libopus newfilename.ogg

The bitrate probably doesn't matter to the WhatsApp API. The file you
checked against is probably VBR anyway. On the other hand, WhatsApp
might be picky about VBR mode (off/on/constained) - the libopus encoder
has the "-vbr" option to controll that.

To achieve one channel 16 kHz output:

$ ffmpeg -i audio.mp3 -c:a libopus -ac 1 -ar 16k newfilename.ogg

By the way, doing this, ffmpeg will tell you:

[libopus @ 0xb1a99c0] No bit rate set. Defaulting to 64000 bps.

To change that, use the "-b:a" option.

> Is the Writing library " Lavf58.28.102" the same as "WhatsApp"?

Certainly not, but it shouldn't matter to the WhatsApp API.

Cheers,
Moritz


More information about the ffmpeg-user mailing list