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

Robert Keir robertk at smithpower.co.za
Thu Jul 18 16:36:49 EEST 2019

Thank you.

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". I convert it using 

ffmpeg -i audio.mp3 -c:a libopus newfilename.ogg

newfilename.ogg does not play in whatsapp when I send it. 

I downloaded a whatsapp voice note that does work in whatsapp and looked at the properties of the file (Below)

===================== General =====================
Complete name               : C:\Users\user\Desktop\opusvoice.ogg
Format                      : Ogg
File size                   : 36.1 KB
Duration (ms)               : 15s 507ms
Overall bit rate            : 19.1 Kbps

===================== Audio =====================
Id                          : 100 (0x64)
Format                      : Opus
Duration (ms)               : 15s 507ms
Channel(s)                  : 1 channel
Channel positions           : Front: C
Sampling rate               : 16.0 KHz
Compression mode            : Lossy
Writing library             : WhatsApp

I'm trying to match it so that it works.

What do you think?

-----Original Message-----
From: ffmpeg-user [mailto:ffmpeg-user-bounces at ffmpeg.org] On Behalf Of Ted Park
Sent: Thursday, July 18, 2019 3:31 PM
To: FFmpeg user questions <ffmpeg-user at ffmpeg.org>
Subject: Re: [FFmpeg-user] ffmpeg convert mp3 to opus codec (contained in ogg format)?

> Thank you. I'm new and still learning. :-)

That’s good, but in that spirit, you should look up what top-posting is and avoid doing it in this mailing list.

> I need to convert with the following settings:
> Bitrate of 19.1kbps
> 1 channel
> Sample rate of 16.0khz

That would look like this:
ffmpeg -i audio.mp3 -c:a libopus -b 19.1k -ac 1 -r 16k newfilename.ogg But I hesitate to just give you a command you might not understand because a lot of your questions don’t quite make sense… Such as
> Is the Writing library " Lavf58.28.102" the same as "WhatsApp"?

What is it that you’re trying to do? It’ll be easier to help if you give us a bigger picture.
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org

To unsubscribe, visit link above, or email ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-user mailing list