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

Ted Park kumowoon1025 at gmail.com
Thu Jul 18 16:42:13 EEST 2019


> 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?
> 

I think this is now a WhatsApp API question more than an ffmpeg one, but anyway, did you set the content type when you uploaded the media? Like audio/ogg.

P.S. You are still top-posting...


More information about the ffmpeg-user mailing list