![]() |
linux.oldcrank.com:
A Simple mp3 to Ogg
Conversion Script
Updated 6/25/04! v2.0.6 "Trey's Switch"
©2004 Loran T. Hughes
All Rights Reserved
I had the opportunity to help a friend convert his mp3 files to Ogg Vorbis format a while back. Of course, I wrote a script to automate the process (hey, this is Linux after all!).
Since RedHat stopped support for the mp3 format, mp3ogg will be useful to users of recent RedHat and Fedora distributions. This script may be run against single files, multiple files, or an entire directory. The script gives the option of deleting the original mp3's, is smart enough to skip non-mp3 files, and has the ability to use the original file's bitrate / ID3 info.
Credits
Thanks to Trey Hunner for providing error supression and deletion switchs.
Instructions
Download mp3ogg. Place the script in /sbin and change permissions to 755 (i.e., chmod 755 mp3ogg). If not already on your system, download and install mpg123 (v0.59r or later), oggenc, and mp3info (optional, but highly recommended).
Command line syntax:
$ mp3ogg [-s] [-d] [file1.mp3 file2.mp3 "filename with spaces.mp3" ...]
To run against an entire directory:
$ cd music_dir
$ mp3ogg [-s] [-d]
Notes
mp3ogg will give you the option of keeping or deleting your original mp3 files as it converts to Ogg. If running against an entire directory, mp3ogg will only attempt to convert files with the '.mp3' extension and skip non-mp3 files.
If mp3info is installed, mp3ogg will convert at the original file's bitrate and transfers original ID3 info to the new file (song title, artist, etc.). If mp3info is not installed, mp3ogg converts at a set bitrate of 128 kb/s.
Questions or Comments?
This is a free, GPL'd script which you may use at your own risk. Email me at with your comments or questions.






