Page 1 of 5 123 ... LastLast
Results 1 to 10 of 45

Thread: Easily convert your music library from mp3 to ogg

  1. #1
    Join Date
    Mar 2006
    Location
    Philadelphia, PA
    Beans
    472

    Easily convert your music library from mp3 to ogg (or flac)

    Hello all,

    Well I've been wanting to convert all my music from mp3 to ogg and quickly found that there was no real easy way to do it. So I made a small command line utility to do exactly that. Because I really hate mp3 and proprietary formats because they are such a pain in the butt and in the US (as far as I know) they are illegal or so I thought. Well anyway, I was just reading reading the topic about how many songs you have in your library and I think everyone who replied to that topic had their entire library in mp3 and Im sure that alot of people would like to support the open format, if it were only easier.

    So I called my utility am2o (auto mp3 to ogg) and its written in PHP (no it does NOT require a webserver what so ever, its a command line utility). I purposely wrote it in PHP to show people that PHP is just like any other scripting language and to debunk the misconception that its only for websites. It also wraps around ffmpeg to do the transcoding.

    My personal need for it was to take all the music that I download from gnutella (frostwire/limewire/gtk-gnutella/etc) and convert it to ogg and put it in my music directory and when you download alot of mp3's you keep them in the same folder and when you rerun the command you dont want to re-transcode all of the music thats already transcoded, so it supports filename caching for each unique directory. You may optionally disable caching as well.

    To run it you need the ffmpeg and php5-cli packages from the repository. You can get them from Synaptic, or by command line.
    Code:
    sudo apt-get install ffmpeg php5-cli
    The package itself is attached to this post. To install it just unpack the tarball then run:
    Code:
    cd am2o
    sudo ./install.sh
    Examples on how to use the program are included in the readme but heres one for a quickstart, its really easy.
    Code:
    am2o -i ./Shared -o ./Music
    We use -c to enable filename caching (this flag is require, to disable use -c=no), and ./Shared is our input folder (where we will pull mp3's from) and ./Music is the output folder (where we put the transcoded ogg's).
    NOTE: As of version 0.2, the -c flag is no longer required and will automatically default to yes if left out.

    If you have a big music library that you are transcoding, and you have a multi or dual core CPU system, I dont recommend running multiple instances as this will probably cause it to clash if you are running it on the same directories. Maybe in the future, if people like this tool, I will add support for multiple ffmpeg instances to encode multiple files at a time.

    I hope this tool inspires you to convert to and use ogg to support it as an open format.

    [Edit]
    I have released am2o v0.2 with support for lossless flac and flexible flags and arguments. You may use all flags/arguments in any order but you must use the -i and -o flags to specify input and output directories respectively. The default transcode format is ogg, if you would like to transcode to flac, you must use the '-f flac' flag. Refer the '-h' or the readme for more information.

    Enjoy!
    -maddog39
    Attached Files Attached Files
    Last edited by maddog39; July 9th, 2007 at 11:58 PM.
    Ubuntu User #: 0x2695 | Banshee 1.8/2.0 Pidgin Plugin

    Intel Q6600 @3.21, 4GB, GTX260, ArchLinux
    Lenovo IdeaPad S10, 1.6GHz Intel Atom, ArchLinux

  2. #2
    Join Date
    Mar 2006
    Beans
    2,423

    Re: Easily convert your music library from mp3 to ogg

    Wow! Thanks so much!

    Again, open-source at its best!

  3. #3
    Join Date
    Oct 2005
    Beans
    64
    Distro
    Kubuntu 15.10 Wily Werewolf

    Re: Easily convert your music library from mp3 to ogg

    Quote Originally Posted by maddog39 View Post
    I hope this tool inspires you to convert to and use ogg to support it as an open format.
    I'm sorry to say this after all your hard work, but I hope it doesn't. Transcoding from a lossy format to another lossy format results in huge quality loss, and the mp3's you can download with p2p networks are often bad quality already. If you're an open-source zealot I don't think you'll care, but if you love music you will.

  4. #4
    Join Date
    May 2006
    Location
    Sweden
    Beans
    Hidden!

    Re: Easily convert your music library from mp3 to ogg

    As Arathorn said, DON'T convert between the two formats if you care about the music quality.

    Mp3, as well as ogg, is a lossy format. This means some of the information in the raw music files are thrown away to save disk space. That is generally a good thing, because otherwise the files would have been some 5-10 times larger. However, it also lowers the quality of the music. The more compression, the worse it gets. At 192 kbit/s it's almost always impossible to hear any difference, at 128 kbit/s you can hear it if you've got some good equipment and at lower bitrates it's generally quite easy to hear the difference from a CD.

    The mp3-making application chooses which part of the music to discard based on an algorithm. It's designed to keep the audible sound and discard the sound that you cannot hear anyway (there's a lot of that in a regular pop song). Ogg Vorbis has a similar algorithm but it's a bit different, which means if you convert from mp3 to ogg you will get the losses of both compression algorithms. The result is a file that may sound considerably worse than the original mp3.

    If you want to use ogg, then use it when you rip your CDs. Then you'll only get the compression losses from the ogg algorithm and not from the mp3 algorithm as well.

  5. #5
    Join Date
    Oct 2005
    Beans
    64
    Distro
    Kubuntu 15.10 Wily Werewolf

    Re: Easily convert your music library from mp3 to ogg

    Or just use FLAC. You can even find quite a lot of that on P2P, but it will take longer to get, because there are less sources and the files are bigger.

  6. #6
    Join Date
    Jun 2005
    Location
    Australia
    Beans
    247
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Easily convert your music library from mp3 to ogg

    Nice work

  7. #7
    Join Date
    Sep 2005
    Location
    Leeds, West Yorkshire, UK
    Beans
    58
    Distro
    Kubuntu 6.06 Dapper

    Re: Easily convert your music library from mp3 to ogg

    Quote Originally Posted by Arathorn View Post
    I'm sorry to say this after all your hard work, but I hope it doesn't. Transcoding from a lossy format to another lossy format results in huge quality loss, and the mp3's you can download with p2p networks are often bad quality already. If you're an open-source zealot I don't think you'll care, but if you love music you will.
    This is exactly why I am re-ripping my entire collection again!

    Diesel1.
    Registered GNU/Linux user #140607.

  8. #8
    Join Date
    Jun 2007
    Beans
    77

    Re: Easily convert your music library from mp3 to ogg

    Now all I need to do is buy a media player that supports OGG and I'll be set.

    I'll just throw away this perfectly good MP3 player and spend money for one that supports OGG. Thank goodness for open source!


  9. #9
    Join Date
    Mar 2006
    Location
    Philadelphia, PA
    Beans
    472

    Re: Easily convert your music library from mp3 to ogg

    Heh, well I do realize that both mp3 and ogg are lossy formats and that you may lose some quality, but all the songs that I transcoded sound awsome, and I play them on studio headphones fairly loud. There are only a few songs where i can notice it. Perhaps adding a function to transcode to flac would make a difference?
    Ubuntu User #: 0x2695 | Banshee 1.8/2.0 Pidgin Plugin

    Intel Q6600 @3.21, 4GB, GTX260, ArchLinux
    Lenovo IdeaPad S10, 1.6GHz Intel Atom, ArchLinux

  10. #10
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: Easily convert your music library from mp3 to ogg

    Quote Originally Posted by maddog39 View Post
    Well I've been wanting to convert all my music from mp3 to ogg and quickly found that there was no real easy way to do it. So I made a small command line utility to do exactly that.
    There's also mp32ogg and dir2ogg in the the repos. mp32ogg can convert songs or entire folders and it preserves the tags.

Page 1 of 5 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •