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

Reino Wijnsma rwijnsma at xs4all.nl
Thu Jul 18 17:12:36 EEST 2019

First of all (again), stop top-posting here!

On 18-7-2019 15:36, Robert Keir <robertk at smithpower.co.za> wrote:
> I'm trying to convert an mp3 file to ogg file to send through to a WhatApp contact through their API. The Whatsapp API only accepts " audio ogg-file in opus codec".

So if I understand correctly, you're pressing the paperclip and "Audio"? If so, then I guess Whatsapp will always convert this audiofile indeed.
Instead, simply press the paperclip and "Document" to send the mp3 file as is. Then you don't have to convert to opus either.

> I convert it using 
> ffmpeg -i audio.mp3 -c:a libopus newfilename.ogg

On 18-7-2019 15:30, Ted Park <kumowoon1025 at gmail.com> wrote:
> ffmpeg -i audio.mp3 -c:a libopus -b 19.1k -ac 1 -r 16k newfilename.ogg

Why haven't you tried the command suggested by Ted?

-b 19.1k needs to be -b:a 19.1k btw.
Opus uses 1 samplerate: 48000Hz. So -r 16k would only needlessly hurt your audiofile.
But again, if above works, then you don't have to convert to opus in the first place.

On 18-7-2019 15:23, Robert Keir <robertk at smithpower.co.za> wrote:
> Is the Writing library " Lavf58.28.102" the same as "WhatsApp"?

This 'opusvoice.ogg' file of yours was made by Whatsapp.
You used FFmpeg to create 'newfilename.ogg' which used the "Lavf58.28.102" library to convert the audio to opus.
That's all.

-- Reino

More information about the ffmpeg-user mailing list