4

We need to play MP3 files in jPlayer without using Flash as a fallback.

For playing these files with Firefox, I want to convert it to Ogg. Do you guys have any options/alternative for this? I tried to use dir2ogg in CentOS, but it says "no DECODER found for MP3".

Please recommend a tool for converting MP3 to Ogg in CentOS.

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
RickDavis
  • 2,276
  • 6
  • 25
  • 31

3 Answers3

18

You can also try using sox:

sox input.mp3 output.ogg

That should do the trick.

P.S: sox is available through yum on CentOS.

Flinth
  • 487
  • 2
  • 9
  • 3
    On Fedora 20, I also needed to package *sox-plugins-freeworld* from rpmfusion-free (for the MP3 suppport) – Alois Mahdal Sep 02 '14 at 16:45
  • 1
    Thanks for the tip about sox-plugin-freeworld @AloisMahdal - got message "sox FAIL formats: no handler for file extension `mp3'" without that plugin. – Ian Ellis Apr 14 '18 at 19:23
  • 1
    I had to install `sudo apt-get install libsox-fmt-mp3` with `sox` to make it work. – Stefan Falk Jan 26 '20 at 17:45
1

I typically use FFmpeg for this:

ffmpeg -i source.mp3 -codec:a libvorbis -qscale:a 8 output.ogg

Note though that you should really convert from the lossless source, not an MP3. You're losing another level of quality by using a lossy codec on a file that was already compressed with a lossy codec.

Also, given the time of the question, I assume you wanted to use Vorbis for the codec. For anyone finding this answer now, consider Opus. It will fit in your Ogg container, but has much higher quality for a given bitrate.

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Brad
  • 159,648
  • 54
  • 349
  • 530
  • Can you please elaborate more on converting using FFMPEG. – RickDavis Jun 20 '12 at 05:21
  • @rao.ghuge, Just run `ffmpeg`, with your input file as your MP3, and your output file as OGG with whatever quality and other settings you want. Nothing more to it! http://howto-pages.org/ffmpeg/#basicaudio – Brad Jun 20 '12 at 05:58
  • I installed FFMPEG on CentOS and converted MP3 files to OGG. But these OGG files are not being played in JPlayer in FF Browser. – RickDavis Jun 27 '12 at 08:38
  • @RaoG, Can you post a sample file somewhere? I'd recommend opening a new question, and including a link to your sample file. There's probably something up with the encoding settings used. – Brad Jun 27 '12 at 12:46
  • 1
    Shocked about negatives without comments for a tool that does the job... Thank you for the answer, Brad – Jose Manuel Gomez Alvarez Feb 22 '20 at 11:51
0

There is a fine audio/video conversion utility avconv. So are able to do:

 avconv -i file.mp3 file.ogg

Unlike sox it is able to convert also aac, and webm formats.

Малъ Скрылевъ
  • 16,187
  • 5
  • 56
  • 69