Slashdot Mirror


Batch Converting Between Formats?

Yort asks: "With the Christmas season upon us, it's time to dust off the Yuletide music. However, I'm finding once again this year that I'm needing to re-rip all my CDs to fit the format-of-the-year. Ogg Vorbis for my portable, MP3 for the Tivo, WMA and AAC for sharing with co-workers... Argh! So, I've decided it's time to end the madness: Hard drives are cheap, so I'm going to rip all my music once-and-for-all to a lossless format (I'm choosing FLAC at this point), then just batch convert to whatever format I need. I know I'm hardly the first one to think of this, but I've looked around and haven't found much in the way of good OSS tools for this sort of thing. Any recommendations, or do I have to write one myself?"

94 comments

  1. sounds like a job for by Gherald · · Score: 4, Insightful

    bash

  2. just a simple frelling script. by Gadzinka · · Score: 4, Informative
    Well, I don't know about applications to recode to different formats, but I do use mp3 for transferring music to my Creative MuVo. It was just a simple script written in couple of minutes:
    #! /bin/sh

    br="96"

    if [ "$1" = "-b" ] ; then
    br="$2"
    shift;shift
    fi

    sdir=`echo "$1"|sed 's|/$||'`
    ldir=`dirname "$sdir"`
    ddir=/home/queue

    if file "$sdir" | grep -qs directory ; then
    find "$sdir" -print | while read src ; do
    dst=`echo "$src" | sed "s|$ldir|$ddir|; s/\.\([oO][gG][gG]\|[fF][lL][aA][cC]\|[mM][pP]3\)$ /.mp3/"`
    case `file -b "$src"` in
    *directory* )
    mkdir "$dst"
    ;;
    *FLAC* | *Vorbis* )
    ogg123 -d wav -f - "$src" |lame -h --abr "$br" - "$dst"
    tagcopy "$src" "$dst"
    ;;
    *MP3* )
    lame -h --abr "$br" "$src" "$dst"
    tagcopy "$src" "$dst"
    ;;
    * )
    cp "$src" "$dst"
    ;;
    esac
    done
    fi
    You have to give it full path from / and tagcopy is a simple wrapper around taglib C API to copy ID3 (or equivalent) tags between two files.

    Just use it as an example to create scripts converting to other formats.

    Robert
    --
    Bastard Operator From 193.219.28.162
    1. Re:just a simple frelling script. by Gadzinka · · Score: 1
      well, in case anyone needs it, here's tagcopy.c
      /* compile with
      * gcc -o tagcopy -ltag_c tagcopy.c
      */

      #include <stdio.h>
      #include <unistd.h>
      #include <taglib/tag_c.h>

      #ifndef FALSE
      #define FALSE 0
      #endif

      int main(int argc, char *argv[])
      {
      TagLib_File *ifile, *ofile;
      TagLib_Tag *itag, *otag;

      if (argc != 3) {
      printf("Usage: %s from_file to_file\n", argv[0]);
      exit(1);
      }

      taglib_set_strings_unicode(FALSE);

      if (access(argv[1], R_OK)) {
      printf("%s: Couldn't open '%s' for reading\n", argv[0], argv[1]);
      exit(1);
      }

      if (access(argv[2], W_OK)) {
      printf("%s: Couldn't open '%s' for writing\n", argv[0], argv[2]);
      exit(1);
      }

      ifile = taglib_file_new(argv[1]);
      itag = taglib_file_tag(ifile);

      ofile = taglib_file_new(argv[2]);
      otag = taglib_file_tag(ofile);

      taglib_tag_set_title(otag, taglib_tag_title(itag));
      taglib_tag_set_artist(otag, taglib_tag_artist(itag));
      taglib_tag_set_album(otag, taglib_tag_album(itag));
      taglib_tag_set_year(otag, taglib_tag_year(itag));
      taglib_tag_set_comment(otag, taglib_tag_comment(itag));
      taglib_tag_set_track(otag, taglib_tag_track(itag));
      taglib_tag_set_genre(otag, taglib_tag_genre(itag));

      taglib_tag_free_strings();
      taglib_file_free(ifile);
      taglib_file_save(ofile);
      taglib_file_free(ofile);

      return 0;
      }
      --
      Bastard Operator From 193.219.28.162
  3. Use mencoder by madaxe42 · · Score: 1
    And a script that runs along the lines of
    rm todo
    ls > todo
    NUMFILES=`wc -l todo | grep -o [0-9]*`
    for ((a=1; a <= $NUMFILES; a++)); do FILENAME=`head -n $a todo | tail -n 1`

    echo
    echo
    echo
    echo "DOING FIRST PASS ON $FILENAME, $a of $NUMFILES"
    echo
    echo
    echo
    mencoder "$FILENAME" -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:acodec=ac3 -oac lavc -o ../fixed/"$FILENAME"
    echo
    echo
    echo
    echo "DOING SECOND PASS ON $FILENAME, $a of $NUMFILES"
    echo
    echo
    echo
    mencoder "$FILENAME" -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:acodec=ac3 -oac lavc -o ../fixed/"$FILENAME"
    done

    And modify as you see fit - I currently use it for converting movies to xvid with AAC - it works, usually!
    1. Re:Use mencoder by julie-h · · Score: 1

      Why do you do a second encoding?

      Have you tried doing a "diff" on the pass1 and pass2 file? I am pretty sure, that a second pass encoding only works with video with VBR, not sound.

    2. Re:Use mencoder by pyite · · Score: 1

      Erm... seems like you're complicating things.

      #!/bin/sh
      for file in *;
      do mencoder $file OPTIONS ../fixed/$file;
      done;

      --

      "Nature doesn't care how smart you are. You can still be wrong." - Richard Feynman

    3. Re:Use mencoder by ak_hepcat · · Score: 1

      Problem with this technique, and it's addressed by the bash script up above, is that any time you have a token break between symbols encoded in the filename, your loop breaks because it can't parse the filename correctly.

      In other words, spaces in a filename kill this simple loop.

      --
      Support FSF: Stop thinking with your wallet, and think with your imagination. (cc/non-commercial)
    4. Re:Use mencoder by pyite · · Score: 1

      #!/bin/sh rename "s/ /_/g" * for file in *; do mencoder $file OPTIONS ../fixed/$file; done; Fixed! Well, in all seriousness, you are correct sir. However, the thought never even crossed my mind as I never ever use spaces in filenames because it screws up all sorts of tokenization, including this.

      --

      "Nature doesn't care how smart you are. You can still be wrong." - Richard Feynman

  4. Script it dear liza... by Anonymous Coward · · Score: 0

    perl or python ?

    Replies to this post will accept single line or short solutions in the language of your choice which work with the following command line (assuming source and dest dirs already exist and mp3/ogg/flac tools have been installed and in the path):

    convert [source directory] [destination directory] [format=mp3/ogg] [bitrate(int)]

  5. Konqueror + kio_audiocd by MarkKnopfler · · Score: 2, Interesting

    You can do what I do these days-- Use the konqueror + kio_audiocd combo. Really smooth. All you have to do is to insert the audio cd and browse it using konquerer ( audiocd:// ) You will actually see an ogg directory. All that is to be done is a simple drag and drop. You wont have to do any scripting. All you have to do is insert your CD and remove it. Redefines the whole ripping experience. I repeat -- Smooth.

    Check this out.

    1. Re:Konqueror + kio_audiocd by magefile · · Score: 1

      Since he's talking about a batch conversion ... is there anyway to automate it? I didn't think so.

    2. Re:Konqueror + kio_audiocd by MarkKnopfler · · Score: 1

      mmm.. actually, the whole requirement for automation was because you did not have an interface which I just defined. Now give me a script which changes cds for me and then I will consider that automation being better than this.

    3. Re:Konqueror + kio_audiocd by iantri · · Score: 1
      Though this is OT, I have a complaint about kio_audiocd:

      The metaphor is broken. It makes no sense. How do you control sampling/bit rate? How do you know which rate will be used?

      Why are there a number of subdirectories that magically appear on the CD? They don't really exist.. it is confusing and it is a bad idea.

    4. Re:Konqueror + kio_audiocd by kinzillah · · Score: 1

      Buy two cd libraries and send one to me and I will.

      --
      Douglas P. Price
  6. A summary by dasunt · · Score: 3, Informative

    Several votes for bash, and a mention of python or perl so far.

    Any scripting language will work. Check out freshmeat and sourceforge, there are several scripts available that will access the CDDB and dump the artist/track information.

    The only thing missing is a trained monkey to operate the CD drive all day. Better start searching. :)

    1. Re:A summary by krymsin01 · · Score: 1

      Why do you need so many file formats? What's wrong with picking one (let's say mp3 since it's pretty well supported across the board) format?

      --
      stuff
    2. Re:A summary by harrkev · · Score: 2, Interesting

      Well, I think that the original question answered this one pretty well.

      MP3 is the universal format, but newer codecs can do more with less bits. As a result, using another codec, you can have more songs for the same quality, or more quality for the same number of songs. The problem is that there is no such thing as a universal next-generation codec. Apple has their own (DRM galore), Microsoft has their own (mega-DRM galore), and OSS people have their own. And no device that I know of supports all of them (and if it did, I couln't afford it).

      So, the approach of the original post seems valid. Grab everything as FLAC, and convert to other formats as needed. Less than $100 (after rebates) at your local computer superstore will get you enough space to hold over 500 CDs worth of music in FLAC.

      --
      "-1 Troll" is the apparently the same as "-1 I disagree with you."
    3. Re:A summary by Johnathon_Dough · · Score: 1
      Apple has their own (DRM galore), Microsoft has their own (mega-DRM galore)

      At least be fair to both companies. Both AAC and WMA can be created without DRM. It is only when you purchase songs that they have the DRM wrappers.

      Not sure about the WMA, but I know that you can't actually add Fairplay DRM to your own rips of AAC

      --
      If you are one in a million, then there are six thousand people who are just like you.
  7. One thing I have wanted to use by Christopheles · · Score: 2, Interesting

    Is a VFS module for samba called File Ext Map. It takes a share, and a file indicating what conversions to perform, and then converts the files on the fly when called. I haven't got it to work with Samba 3, but in theory, you just set up a share of your flac files, and it would show them as ogg files, for instance.

  8. gstreamer by R0 · · Score: 1

    gstreamer has all the bits, you just need to string it together.

    1. Re:gstreamer by Anonymous Coward · · Score: 0

      GStreamer will one day be the world's greatest media Swiss-army-knife...

      It just needs a few more revisions to get there.

      The best overview of GSTreamer I have seen was by Arstechnica as part of their GNOME review. It's about halfway down the page here

      http://arstechnica.com/reviews/os/gnome2.4.ars/4

      Tapeworm

  9. Why? by samael · · Score: 3, Insightful

    Your portable can play MP3. Your Tivo can play MP3. Your friends can play MP3.

    Why not just rip to high-quality MP3 and have done?

    1. Re:Why? by Gherald · · Score: 2

      Why not just rip to high-quality MP3 and have done?

      Maybe because that wouldn't make for a particularly interesting Ask Slashdot.

    2. Re:Why? by richy+freeway · · Score: 3, Insightful

      Cos when the next super MP3alike comes along, he'll have to rip all the tracks again to get the best quality. If he rips them all to a lossless format once, then converts to mp3 now, he can always return to the lossless format and covert them to the new super MP3alike format. Geddit?

    3. Re:Why? by Fweeky · · Score: 2, Insightful

      Because I want a proper backup of my music, with no worries over encoder quality or settings or format limitations or codec choice. Plus, the lossy settings I might use for a portable are probably not the same as those I'd use for my desktop.

    4. Re:Why? by Anonymous Coward · · Score: 0

      Yeah, but he might want to make room on the drive at some later point so he might archive the music to optical.

      You know, burn a lossless format to CD-R or something.

      Why not just use the CDs themselves as a long-term storage of a lossless format?

      It sounds like it is either work now to rip the CDs to FLAC, or work later when he has to re-rip to a better lossy format.

    5. Re:Why? by Captain+Splendid · · Score: 1
      What's with all this talk of the new "mp3-alike" format? We already have tons to choose from, and by the time the new format comes out, disk space will be so cheap, we'll all be using pristine disk images, or using wav/aiff files.

      Hell, for $100 bucks of HD space, I could image over 200 of my CDs right now.

      --
      Linux, you magnificent bastard, I read the fucking manual!
    6. Re:Why? by SillyNickName4me · · Score: 2, Insightful

      > You know, burn a lossless format to CD-R or something.

      Because CD-Rs don't last. Yeah, I can buy them from some brand that gives a lifelong warantee, but really, no amount of money or replacement of CD-Rs is every going to get me back a unique recording so that is utterly pointless.

      Many CD-Rs that I have used so far fail to last for as long as I tend to keep music around, and those that did survive also did degrade noticably (substantially more errors and more jitter when played back on an audio device) Yeah, that was after approx a decade of storing a cd in its jewel case on a spot protected from sunlight and excesive heat and cold.

      > Why not just use the CDs themselves as a long-term storage of a lossless format?

      Scratch scratch, oops, CD unreadable.

      Harddisks fail as well, but solutions to prevent dataloss from disk failure are way more practical for those (mirroring, raid)

      Anout the only better alternative is to burn things to opticals (CD or DVD) in a very clean environment, verify them for proper working, and then seal them into a container with controlled atmosphere, temperature and light (or actually, lack of light). Whenever you need the backup, the first thing you have to do after breaking the seal is repeating the backup process in order to create a new known good backup.

      Of course all hardly relevant unless you care about keeping your music collection around for more then say a decade.

    7. Re:Why? by mikefe · · Score: 1

      "Hell, for $100 bucks of HD space, I could image over 200 of my CDs right now."

      Add two zeros for mp3 or ogg...

      --
      There: Something at a specific location.
      Their: Owned by someone.
      Please make sure your english compiles.
    8. Re:Why? by RevAaron · · Score: 1

      I thought about this too. I tend to rip to a higher bitrate of MP3s- 256/VBR or so- but then it sucks when I want to put some MP3s on my PDA, where a 140 MB album is a bit overkill. It's a shame there's not some mp3->ogg fairy that would do the conversion without possibly killing sound...

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    9. Re:Why? by RevAaron · · Score: 1

      You're very right- the optical media we have now sucks. It can go to crap in a couple years, and this is sadly not all that rare. But a HD isn't the solution either... What I do for my "unique recordings" is etch the information into metal plates, you know, like L. Ron Hubbard. Sure, whenever I want to listen to a song I end up spending a lot of time transcribing the information into a hexeditor, and then playing it in iTunes. Sure, a pain in the butt, but it's worth it!

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    10. Re:Why? by x102output · · Score: 1

      because even at hi-quality MP3s (for example, --alt-preset extreme), mp3s still don't sound as good as FLACs or any lossless audio on a good system. mp3s are great for portable players, but horrible for archival use. i have several thousand albums in mp3 and now im getting into FLAC, wishing I had gotten into it long ago.

    11. Re:Why? by angle_slam · · Score: 1
      > Why not just use the CDs themselves as a long-term storage of a lossless format?

      Scratch scratch, oops, CD unreadable.

      Take the CD. Rip it. Never use itagain. The CD is in pristine condition. If the HD fails, re-rip. If you have to listen to an actual optical disc (like in a car), just burn a copy.

      Plus, you underestimate the durability of CDs. If you've ever checked out library CDs, those suckers gets scratched to hell in back. I'd guess that well over 98% of the CDs I've borrowed from the library have been rippable.

      Anout the only better alternative is to burn things to opticals (CD or DVD) in a very clean environment, verify them for proper working, and then seal them into a container with controlled atmosphere, temperature and light (or actually, lack of light). Whenever you need the backup, the first thing you have to do after breaking the seal is repeating the backup process in order to create a new known good backup. Of course all hardly relevant unless you care about keeping your music collection around for more then say a decade.

      You're a little paranoid here. I have several pressed CDs that I bought 16 or more years ago that are perfectly playble. In fact, I've never had a pressed CD fail on me other than through scratching (and I should use the term gouging, not scratching).

    12. Re:Why? by SillyNickName4me · · Score: 1

      > Take the CD. Rip it. Never use itagain. The CD is in pristine condition. If the HD fails, re-rip. If you have to listen to an actual optical disc (like in a car), just burn a copy.

      And it still can get scratched (when putting it into/removign it from the reader or jewel case for example). CHances are lower, but not zero.

      > Plus, you underestimate the durability of CDs. If you've ever checked out library CDs, those suckers gets scratched to hell in back. I'd guess that well over 98% of the CDs I've borrowed from the library have been rippable.

      No I don't. Scratch the top layer and the disk is no longer sealed and will start degrading rapidly.

      You obviously never looked at how often library CDs have to be replaced. I don't know about the local library here, but shops here where you can rent cds and dvds are complaining quite a bit about this.

      The fact that you managed to rip from library cds in many cases is because they care enough to not keep the bad discs in there, not because discs last that long. Also, rippable does not mean you get a very good copy, I'd really loook a bit more into how error correction for audio cds works.

      At any rate, when no accidents happen and you are extremely carefull then CDs can last a long time, but when you talk about 'backup', then this is really not enough. THe simple fact that they use optics that require a high level of accuracy makes them vulnerable.

  10. You need a seperate tool? by Fweeky · · Score: 0, Offtopic

    My audio player knows how to transcode between arbitary formats, amongst plenty of other things. Just select the tracks you want converting, right click, select Convert, select the format, select the destination; if your player doesn't have similar functionality perhaps you should consider finding a better player?

    1. Re:You need a seperate tool? by Jussi+K.+Kojootti · · Score: 1
      The guy specifically asked for open source batch conversion. Foobar is an ok player but it's not OSS and I doubt it supports batch jobs. It's also Windows only.

      Maybe you're right, and he should just find a better player - I don't think it's Foobar though.

    2. Re:You need a seperate tool? by delus10n0 · · Score: 1

      It does do batch jobs. I just converted ~5000 MPC/FLAC/MP3/OGG files to M4A, via Nero's MP4 encoding plugin and Foobar2000. Foobar also automagically copied the tags from the MPC/FLAC/MP3/OGG files to the new M4A files.

      (Why did I convert all those to M4A? They're for a smaller portable drive I bring to and from work..)

      Also, there's a program called Mareo (I think it's open source, but I don't remember) which will call multiple encoding/tagging programs when you pass in a single set of data. So when I rip with Exact Audio Copy, it encodes into FLAC and MP3/MP4 for me automatically.

      Anyhow, this Ask Slashdot is incredibly silly. A 5 minute search on Google would turn up the answers this person seeks.

      --
      Not All Who Wander Are Lost
    3. Re:You need a seperate tool? by Yort · · Score: 1
      I did do a Google search, and waded through all sorts of possibilities at Sourceforge, HandyAudio, and Download.com, but I didn't catch that Foobar2000 did conversion. I've used that on the Windows side, so that might fit the bill nicely over there.

      For anyone else who may not be familiar with Foobar2000 and its syntax, I went to Convert->Settings and checked the "Create Subdirectories" box, then set my output format string to be the following so that it put things in the appropriate artist/album heirarchy:

      /%artist%/%album%/%_filename%

      Seems to work nicely. Thanks! I'm sure I can easily adapt any of the other scripts posted for my Linux needs.

    4. Re:You need a seperate tool? by ponos · · Score: 1
      My audio player knows how to transcode between arbitary formats, amongst plenty of other things. Just select the tracks you want converting, right click, select Convert, select the format, select the destination; if your player doesn't have similar functionality perhaps you should consider finding a better player?

      Transcoding between lossy formats is not a good idea. Every iteration will greatly deteriorate the output. The explanation is quite technical and I am not an audio engineer/mathematician, but trust me on this one. That's the whole point of using flac as a reference archival format.

      P.

      P.S. By the way, I forgot to say that an obvious way to do the batch transcoding would be a ... Makefile. Not very portable but quite appropriate, don't you think?

    5. Re:You need a seperate tool? by delus10n0 · · Score: 1

      I use a similiar naming string.. something like this..

      For single artist albums: /%artist%/%album% [%albumyear%]/%trackno% %title%

      For multi artist albums: /Compilations/%album% [%albumyear%]/%trackno% %trackartist% - %title%

      Works pretty well for my needs. I've also put the year at the beginning, to make it easy to see what albums came in what order.. but I don't like the presentation of that file-system wise. I'd rather load it all into FooBar/iTunes/whatever and have the sorting occur in there.

      --
      Not All Who Wander Are Lost
    6. Re:You need a seperate tool? by Yort · · Score: 1

      Is that a manual distinction (single vs. compilation), or can Foobar detect this automatically (assuming the cddb info is correct)?

    7. Re:You need a seperate tool? by delus10n0 · · Score: 2, Informative

      When I rip with Exact Audio Copy, I have it throw Various Artist rips into a seperate directory, and then I use FooBar to add a "Compilation = True" tag to the files, before I use FooBar to rename them out to their final directories. Using FooBar's scripting, you can pull something off like this: /$if(%compilation%,Compilations,%artist%)/%album% [%date%]/%tracknumber% $if(%compilation%,%artist% - ,)%title

      That will add the "Artist - " in front of the song titles and stick them under Compilations, if they are tagged as such (like I mentioned before.)

      It seems tedious, but it's really not that difficult.

      For tagging, you might want to check out MusicBrainz, it only works on MP3s, but it can scan the MP3's contents and try to guess the proper tag data.. it's actually fairly accurate. For general tagging, I use a program called TheGodfather. It's able to tap into Amazon.com for album cover images, and a user supplied script (on the GodFather forums) can read directly from AllMusic.com

      --
      Not All Who Wander Are Lost
    8. Re:You need a seperate tool? by mvdw · · Score: 1

      Not to argue with you at all, but what's with the business of a Makefile not being very portable?? I'd say that a Makefile would be one of the most portable solutions; I guess it will depend on what tools the Makefile calls, but these could be wrapped in some conditionals, surely?

    9. Re:You need a seperate tool? by Fweeky · · Score: 1

      Sure; but "arbitary format" means I can go from FLAC/APE/WavPack/OptimFrog/WAV to any of those, plus to any lossy format, plus from said lossy formats should I really, *really* need to.

    10. Re:You need a seperate tool? by Fweeky · · Score: 1

      Foobar provides you with enough rope to detect the way you prefer to do it automatically.

      I've got single tracks tagged with %singletrack%, and compilations with an %album artist% tag as well as the track %artist%. It's a few $if() statements in your formatting strings to teach it, be that in the playlist, status bars, or the database display. I find most existing format strings support this by default, but of course if you want to do something different.. foobar won't stop you :)

  11. The Master Of Audio by Goo.cc · · Score: 2, Informative

    Go to this website:

    http://www.hydrogenaudio.org/

    (Read and search the site before asking any questions.)

  12. Makefile by xFallenAngel · · Score: 5, Interesting
    You could actually write a makefile that utilizes the separate converters and outputs as wanted...

    make ogg
    make mp3
    make wma
    make rip

    Something alont those lines...I'll leave the Makefile as an excersize for the reader :)

    1. Re: Makefile by Black+Parrot · · Score: 3, Funny


      > You could actually write a makefile that utilizes the separate converters and outputs as wanted...

      > make ogg
      > make mp3
      > make wma
      > make rip

      Don't forget the all-important -

      make morediskspace

      --
      Sheesh, evil *and* a jerk. -- Jade
    2. Re: Makefile by Tackhead · · Score: 1
      > > You could actually write a makefile that utilizes the separate converters and outputs as wanted...
      > > make ogg
      > > make mp3
      > > make wma
      > > make rip
      >
      > Don't forget the all-important -
      >
      > make morediskspace

      Ah just hack something together with a credit card number, and a few calls to wget, curl, and/or lynx to automatically process some HTTP transactions to www.newegg.com!

  13. The script I use... by turnerjh · · Score: 4, Informative

    This is the script I use. Wrote it a while back for basically the same reasons -- record everything in FLAC, convert to lossy format of the week. I originally used a bash script but found it to be a bit less than robust and somewhat more difficult to extend.

    This script either takes command line args, or, if none present, reads filenames one at a time from the command line. Generally I run it via 'find -name "*.flac" | transcode' and let it DTRT. As an added bonus, it copies the id3 tags from src to dest (assuming id3cp is installed)

    http://perl.pattern.net/transcode

    1. Re:The script I use... by Bklyn · · Score: 1

      Nice script. I like the fact that it can do from to . The only problem is that FLAC and OGG don't use ID3 tagging (they use Vorbis Comment blocks).

    2. Re:The script I use... by turnerjh · · Score: 1

      True, but id3cp works fine with copying the tags to those files. The reference implementations of flac properly skip them, but it isn't guaranteed to have that behavior. I've not actually tested ogg's but I would bet it behaves fine there as well; definitely could use improvement in the script, though... patches welcome!

  14. Why? No, you don't. by mbourgon · · Score: 4, Insightful

    I'm needing to re-rip all my CDs to fit the format-of-the-year

    Why? Your coworkers are probably going to look at the extension and say "never mind". Yeah yeah yeah, ogg is great, all hail ogg, but when it gets down to it, there's no reason for you to go through all that effort. MP3s play in everything you mentioned. Ogg is going to be a value-add, but down the road. Same with AAC. For the forseeable future, it's all MP3.

    --
    "Sometimes a woman is a kind of religion, she can save your soul & set you free from all your sins" - Bad Examples
  15. Indeed by turgid · · Score: 2, Informative
    And if you don't know much about bash scripting, you could do a lot worse to learn about it here.

    If you need to write more that about 10-20 lines of bash to make mp3s and oggs out of your flac files, you're doing something wrong.

    It is most satisfying to convert 20 albums from flac to ogg and mp3 while you sleep. The old SETI@home score goes down a bit, though :-)

    1. Re:Indeed by Anonymous Coward · · Score: 0

      Except no 10 to 20 line script is going to preserve TAGs.

      Tag handling in flac is terrible.

      Preserving the tags in the intermediate format (wav) is only part of the problem.

      Handling the special characters typically found in music titles also sucks big nasty chunks in bash (space, ',`, ^, ~, |, etc).

      But I agree. Writing your own shell scripts to do this is the way to go.

  16. jRiver Media Center by GreenKiwi · · Score: 1

    I've been a big fan of jRiver Media Center:
    http://www.musicex.com/mediacenter/

    I decided to go with Monkey's Audio for my lossless format, just because it integrates with it so well. It's a truely amazing program and one of the best rippers around.

    Ripping once to lossless and never doing it again is definitely the way to go.

    kiwi

  17. Flighty by b-baggins · · Score: 1

    This has nothing to do with changing formats and more to do with you being a flighty user who flits from one music format to another.

    MP3 has been around for years and will continue to be around for years. If you had originally ripped all your stuff as MP3, you wouldn't be having this conversation with yourself every year.

    --
    You can tell a great deal about the character of a man by observing those who hate him.
    1. Re:Flighty by SillyNickName4me · · Score: 1

      > If you had originally ripped all your stuff as MP3, you wouldn't be having this conversation with yourself every year.

      Some 8 years ago I started ripping my music colelction to mp3 files. Diskspace constrains and cpu speed made that the only practical choices were 128kbit cbr for most and 192kbit cbr for the things where quality mattered and 128kbti was too much of a limitation. Due to havign a couple hundred cds, this took a few months to complete also.

      About a year ago, I reripped everything to 192kbit vbr (and some at 240kbit vbr), which took just a few days. THe main reason for wanting more quality is that I started using mp3 files for my home audio system (more like a semi professional recording studio then the typical home audio system) more and more, and the quality loss was rather noticable in quite a few cases.

      Now, for a bit more diskspace (which has become a lot cheaper) I get a lot more quality while I am still usign mp3.

      So, even when staying with the same format, there may be reasons to re-encode everything and you can gain quite a bit from doing so.

    2. Re:Flighty by b-baggins · · Score: 1

      You re-ripped once in 8 years. The original poster does it every year. A bit of a difference. You're not flighty. He is.

      --
      You can tell a great deal about the character of a man by observing those who hate him.
    3. Re:Flighty by nightsweat · · Score: 1

      If you had originally ripped all your stuff as MP3, you wouldn't be having this conversation with yourself every year.

      And your music would sound like shit. Sorry, but mp3 just does not sound good on anything more acoustically demanding than small children bashing on pots and pans.

      I like the idea of going lossless and coverting from there to whatever's needed.

      --

      the major advances in civilization are processes which all but wreck the societies in which they occur - A.N. White
  18. Cool idea by megaversal · · Score: 5, Interesting

    I always thought this was a cool idea: http://file-ext-map.sourceforge.net/

    Though not updated in a long while, I think you could use this to automatically convert your flac files to an "mp3 share" and the files would be automatically transcoded to mp3 on the fly as you viewed the Samba share. Just make additional shares for additional file types.

    No need to batch process, whatever you want is done on the fly.

    --
    Sig!
    1. Re:Cool idea by Yort · · Score: 1

      Hmm... I hadn't thought of that. I was considering setting up an old box as a file server in my basement, so this might be just the thing. I'll have to look into it.

    2. Re:Cool idea by 2TecTom · · Score: 2, Interesting

      yes, it is ... in fact, I see no real reason an advanced file system couldn't allow you to access, on the fly, a file in any format the system is capable of reformatting it to. Not only that, but savvy apps should be able to inquire if a file can be reformatted on the fly into a useable format if an incompatibility is encountered.

      take this far enough and you see a universal file system that can proffer data in the format the app requests no matter the way it is stored.

      just a thought

      --
      Words to men, as air to birds.
    3. Re:Cool idea by Bklyn · · Score: 1

      Great concept, the only problem is that the transcoding step can be very slow (e.g. I can encode VBR MP3 with lame --alt-preset standard at about 4x realtime on my machine). Because of this, its nice to have the original conversion results cached so you don't have to regenerate them from scratch every time.

    4. Re:Cool idea by megaversal · · Score: 1

      I'm curious what kind of computer it is. On my laptop I can get mp3s to rip and encode at about 1/2 realtime (so a 4 minute song takes 2 minutes to rip from CD and convert to mp3, cpu seems to stay at ~800mhz during the process).

      And a cache would make sense... something that could eventually be built in if enough people poke around with the code, seeing as how it hasn't been updated since 2002.

      --
      Sig!
    5. Re:Cool idea by megaversal · · Score: 1

      I figure disk space/power usage is what's stopping it. When we have 1TB drives that use a few watts of power, then people will be more interested in having some 3000 albums in FLAC. Then the app just says "hey, give me audio for streaming over the web" and the filesystem transcodes it to a level adequate for that task.

      ext4 maybe? ;)

      --
      Sig!
    6. Re:Cool idea by JabberWokky · · Score: 1
      KDE does something vaguely similar with the audiocd:// URL.

      Reiser4 could accomplish something like this, if I've read correctly. You can access files as directories containing virtual subfiles. Those are provided by plugins, the most obvious being to set metadata and ACL information.

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    7. Re:Cool idea by ddent · · Score: 1

      Filesystem, meet object orientation. OO, meet FS.

  19. etree scripts by tube013 · · Score: 1

    Do a serch for etree scripts and or shn2mp3.

    shn2mp3 is a perl script that can convert a folder of shorten files or flac files to mp3 or ogg.

    this tool was written for live concert trading community so it is more tuned for concert recordings. ie it looks of the accomponing text info file for the concert, and uses the info in that file for the id3 tags (artist, date, venue, source).

  20. What about wav2mp3/wav2ogg? by CertGen · · Score: 2, Informative

    I needed a command-line batch converter so I wrote one and posted it on sourceforge. Check out: http://wav2mp3.sourceforget.net/

    I'm always willing to listen to feature requests. Sounds like a wav2flac equivalent might be something you'd want. I was driven to this solution because lame doesn't support multiple file inputs to convert.

    You can cron the conversion so it happens after hours. Rip during the day, convert at night.

  21. MP3 Will Live Forever by parvenu74 · · Score: 2, Interesting

    It's interesting that this question was posed at this time because I just went through this process with my own music collection recently. I ripped everything to FLAC and then did lots of testing and evaluation as to what file format would be best for my "portable" files. OGG is nice; AAC is Apple's choice (and therefore has a certain sex appeal to it); Sony are being their eccentric selves by going the ATRAC-3 route, and WindowsMedia is, well, WindowsMedia.

    The bottom line is this: is there any digital music device that *cannot* play MP3? Will there ever be a format as pervasive as MP3? Until I have reasonable certainty that I can take audio in "format X" and have it play on every device under the sun, I will stick with MP3 for lossy audio -- because it plays on every device under the sun.

    1. Re:MP3 Will Live Forever by Dick+Faze · · Score: 1
      I will stick with MP3 for lossy audio -- because it plays on every device under the sun.

      How many people are listening on gear that you can actually perceive the loss on anyway? I'd imagine a great deal of listening gets done on crappy 1/8" drivers in headphones or in cars, both environments being far from optimal for perceiving such subtle differences. I'm listening to Sgt. Pepper as I write this, on a $19 MP3 player which delivers higher quality than the gear on which the album was produced, is it really worth the effort to support multiple formats for the 90%?

  22. EAC with FlacAttack by Anonymous Coward · · Score: 1, Informative

    Flacattack is great. Configure a config file and Flacattack does the rest for you. Check out hydrogenaudio.org disuscussion on the lossless forum.

  23. Smart choice with FLAC! We learned the hard way! by linuxbaby · · Score: 3, Informative
    At CD Baby we used to think like the other folks here saying "Why not just use MP3?" We have over 78,000 CDs here, and we hired two people to rip them all to hi-fi MP3 (lame --preset standard).

    But then... digital distribution started last year with Apple iTunes, Napster, Rhapsody, etc. All of these companies REQUIRED that the encoded file (AAC, WMA, etc) come from the master WAV file. Ack! Screwed! 9 months of ripping down the drain!

    So... we finally realized what I was kicking myself for not realizing in the first place - and exactly what the story post mentions: hard drive storage is cheap. labor is expensive. rip the CD *once*, lossless, and NEVER have to rip it again. We wiped all our useless MP3 drives and started again: ripping all 78,000 CDs to FLAC format. Since it's a perfect digital copy of the master audio fles, and supports metadata tags, too, it's the perfect archiving format.

    VERY easy to just script-up a bulk converter. http://perl.pattern.net/transcode is a great Perl solution. I posted my audio-converter scripts here, which include the use of SOX to make 30-second audio clips (since we needed that for work).

    To all those here saying "MP3 is fine!" - you're being short sighted. In a few years there will be a newer better codec, and all your old MP3s will look as bad to your ears as your old 320x240 JPGs from 1995 look now. Go lossless. (FLAC, WAV, etc) - your future self will thank you.

  24. Exactly my thoughts... by ponos · · Score: 2, Insightful

    I totally agree with the original poster. I just made a similar decision and reripped all my (original) CDs to flac, see my weblog http://pkt3141592.blogspot.com/. I have made small scripts (~20 lines each) that convert flac2mp3, flac2vorbis and (flac)m3u to (mp3)m3u files. The neat thing is that I preserve all information tags across formats.

    I usually invoke the mini scripts like : find -name \*.flac -exec flac2vorbis \{\} \; and it works really well. I encoded 35 albums from flac to mp3 for my personal portable audio player in very little time.

    I am now considering an automated script that will generate .tex labels for every directory by reading information tags. It is not very hard to do but getting the output to look nice is going to be quite hard and my TeX skills are a little bit rusty.

    As a side thought I might eventually make an SQL database out of all this music but I don't think my collection will ever grow that much. Anyway, this has been a toy project of mine in the last 3-4 days and it has proved quite useful. I may post the end result (propably a collection of perl and bash magic ;-)) somewhere on sourceforge if it becomes non-trivial.

    P.

    1. Re:Exactly my thoughts... by fiftyfly · · Score: 1

      There are benifits to stuffing this in a db - think smart playlists on 'roids. I came to this conclusion from a different direction when working on a front end for a lan's icecast station. Now though I can use SQL to write playlists which is very tasty.

      --
      "Sanity is not statistical", George Orwell, "1984"
    2. Re:Exactly my thoughts... by RevAaron · · Score: 1

      Why do people seem to think that SQL is the only way to filter and sort data? Don't get me wrong, it's convenient, but no more so than the facilities I've available in the programming system I use. It may be a pain in C/C++/Java though, so I suppose that explains the dblust.

      --

      Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
    3. Re:Exactly my thoughts... by 12+inch+pianist · · Score: 1

      Why not just write your info to XML, then apply XSLT as necessary to fit the app?

    4. Re:Exactly my thoughts... by fiftyfly · · Score: 1
      Why do people seem to think that SQL is the only way to filter and sort data? Don't get me wrong, it's convenient, but no more so than the facilities I've available in the programming system I use. It may be a pain in C/C++/Java though, so I suppose that explains the dblust.

      It's a solved problem and SQL is (relatively) platform agnostic so it's convienient regardless of 'the programming system you use'. Leverage the tools at hand.

      --
      "Sanity is not statistical", George Orwell, "1984"
  25. Here's two scripts to do what you want by Matt+Perry · · Score: 2, Informative
    Here's two scripts to do what you want:

    Hand it a playlist, and it'll convert the files in that playlist to MP3 format.
    http://perlmonks.thepen.com/401680.html

    Batch recursive FLAC to Ogg conversion script
    http://www.buberel.org/linux/batch-flac-to-ogg-con verter.php

    --
    Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
  26. etree-scripts / shn2mp3 by Bklyn · · Score: 2, Informative

    Over the years I've written a number of scripts to deal with lossless audio files (like FLAC and Shorten) and one of them is called "shn2mp3". It can convert SHN or FLAC files to MP3 or OGG files. It is targeted at live concert recordings that are accompanied by a text "info" file that describes the recording gear, setlist etc and this info is parsed and turned into tags. I wasn't, until now, aware of the "tagcopy" command used in another poster's sample script, but I think I'll knock up a new version of my scripts that can be used with this app so as not to require the error-prone text file parsing logic. You can find shn2mp3 and other scripts at: http://etree-scripts.sourceforge.net/ Hope this helps some people.

    1. Re:etree-scripts / shn2mp3 by Bklyn · · Score: 1
  27. if you use Windows...foobar 2000 by holden+caufield · · Score: 1

    Use the audio player foobar 2000 and it's "diskwriter" plugin for the conversions. It's simple and provides support for more audio formats than you'll know what to do with.

    --
    I'll create an amusing sig when I have something meaningful to post.
  28. Re:Smart choice with FLAC! We learned the hard way by Myself · · Score: 1

    Agreed! Ripping is labor-intensive, and metadata is even more so. Getting the FLAC tags right the first time will make everything easier down the road.

    Some time ago, I proposed a way to handle metadata externally, by simply giving each file a name like [cddb-disc-id][tracknumber].extension and then tagging each target format from the local cddb cache.

    How do you handle it if a metadata error is found later? Is there an easy way to regenerate the tags for all the formats when someone edits the master?

  29. Re:Smart choice with FLAC! We learned the hard way by superpulpsicle · · Score: 1

    You know what I never ever understand about ripping. If you have some extremely old CDs, how in the world do you get the labels out of the songs. Wouldn't you have to label song by song manually by hand? You can do it at home, but how do big companies do so freaking many CDs?

  30. On the fly conversion via a samba plugin by chrestomanci · · Score: 1

    Found this useful software:

    http://file-ext-map.sourceforge.net/

    It's a Samba 2.2 virtual file extension.

    So you can save a bunch of .flac files on your (Samba) server, and have them appear as .wav files as well, with the server converting them as they are requested.

    I dare say you could also arrange conversion to mp3 and ogg on the fly as well, though obously not fast enough to keep a 48x cd writer happy.

  31. Re:Why? No, you don't. by angle_slam · · Score: 1

    Completely agree. There is no reason to use anything other than MP3.

  32. Watch folder with distributed encoding? by no_such_user · · Score: 1

    I'd like to rip CDs under Windows, primarily so my wife can rip without needing to switch from her current PC. They'll be etracted to 16bit, 44.1k .wav files and written to a share on a Linux box. From there, I'd like to have the Linux box check the folder every once in a while (via cron I assume) for new files to be encoded. Once it sees a new file, it should encode it to both MP3 and FLAC with id3 tags, and then delete the original. Additionally, I'd like to have the ability to add PCs running Linux (ideally using some sort of CD-bootable distro) to distribute the encoding.

    I know I could do this using Perl/Bash/etc., via cron to make a watch folder and lock files for other machines to signal that they're working with a file. Before I do all that... is there anything out there which does some or all of what I'm trying to do?

    1. Re:Watch folder with distributed encoding? by Anonymous Coward · · Score: 0

      The problem with this is that you would not capture any of the metadata (ID3 or whatever flac uses) during the initial rip to WAV.

      I don't believe there is any capability for metadata in WAV files.

      Once the ones-and-zeros are separated from the CD, it will be very hard to figure out if Beatles-Sergeant Pepper.wav is from the Sergeant Pepper album or from the 1 album or from a greatest hits album....

      Easiest windows ripper that I have found is part of Nero. Once I installed the FLAC plugin, I ripped everything to FLAC. when I need MP3's (rarely...) I just build an M3U in WinAMP and then use the diskwriter output plugin.

      Not really automated or distributed but it works for me..

      Tapeworm

  33. Lossless audio is the way to go. by munpfazy · · Score: 2, Interesting

    I hope the mod-gods will allow a brief tangential rant.

    My prediction: all the people who rip or purchase audio in lossy formats today will hate their decision in a few years. (The only exception is, of course, ripping audio destined solely for a portable player - which is a very different scenario from trying to archive audio in compressed formats.)

    Sure - an mp3 file sounds pretty good, most of the time. It's stunning that it sounds as good as it does. But, it doesn't sound perfect.

    Reasonable people may object that even with perfect hearing and a great pair of headphones, one would only notice a difference between a "lame --preset extreme" file and the original in one album out of a thousand. That's probably true. The same sure isn't true about a 128 cbr file, of the sort one can buy online from a dozen vendors for the same price as a CD - it isn't hard to find a track full of noticeable artifacts when made with the best encoder around. People who encode things are even lower rates ("because it's mostly speech anyway") really shouldn't have to wait around in order to hate themselves - there's plenty of reason to feel bad right now.

    So, why not assume it's good enough and not worry? Here's the catch: the cost of archiving audio in a lossless format is very small today, and will become vanishingly small over the next few years. For something like 15 cents an album at the price of a hard drive (much less if you're archiving to dvd and you buy disks on sale), you can guarantee for all time that your audio will always be good enough. It will sound great on the headphone you're going to buy in five years, to the audiophile spouse you haven't yet met, and even when chopped up added to an audio mix when some radio station geek digs it out of an estate sale seventy five years from now.

    In ten years, when the additional cost of storing your entire audio library in lossless format drops to the price of a meal, you'll hate yourself for not having done so. (Of course those of you silly enough to buy tracks with drm limits on the number of machines on which it can be played are going to hate yourselves much more, and probably somewhat sooner.)

    Just think how annoying it is when you hear a recording of some great, lost radio program that was made on a consumer tape deck set to "long play." If you're anything like me, you curse the short sighted people who bargained away the future for the cost of a dollar cassette.

    And don't assume that you can just run out and pick up a new copy of the album. Even within the mainstream music industry, there are countless lost albums whose masters have been destroyed, and many more which lie abandoned with no promise of a reprinting. There's no reason to believe things will be any different in the future.

    Anyway - to be slightly more on topic - I agree, FLAC is great. Don't know of any exiting conversion utilities, however it would take more than a few dozen lines of perl to throw something together. There are command line tools to rip a cd, run a database lookup, and encode to most formats.

    If you want to make it slighly less annoying, hit a pc junker store and pick up as many cheap old cdrom drives as you have IDE slots. That'll make the disk changing somewhat less annoying. (If you want to go nuts, pick up five 486 pc's, and fill them all with cd drives... that is, assuming spending a weekend setting up an automated super-ripper sounds like more fun than spending a weekend babysitting your cdrom drive.)

  34. FLAC advantages over WAV? by TheLoneGundam · · Score: 1

    I've converted 70+ LPs (yeah I'm old and creaky but so's yer mama) to WAV format. I agree with a poster who said metadata is hard - I had to name all of those wav files with song titles and put them in folders (this is Windows, but that doesn't matter really). I'm assuming if I want to go from WAV to FLAC that I'll need to enter all the metadata for the tags again manually? are tags the _only_ advantage over WAV (stereo 16-bit 44.1KHz i.e. supposedly CD-Audio standard) files? I'd like to get a handle on this question before I start on the cassettes. The goal is to be all digital.

    1. Re:FLAC advantages over WAV? by mp3phish · · Score: 1

      Meta data is not the only advantage to FLAC over WAV. FLAC will do a loss-less compression of approximately 2:1. So you save hard drive space. Flac is also a good standard format because it supports hi quality 24 bit audio if needed (so does wav..)

      The main thing is the compression. The second main thing is the meta data. The third main thing is that FLAC can be played without decompression being a middle step.

      --
      Your ignorance is infinitely greater than you realize.
  35. Or you could stick to one format by Logicdisorder · · Score: 1

    I went though the same thing as this guy did then one day I said "FUCK IT" and I have gone done the AAC path. Used MP3, OGG, FLAC and there has always been some reason I have had to change. The main reason I went with AAC(MP4) is becasue I got an iPod, MP4 is on par with OGG(give or take) and it works in Winamp. I will never use WMA and for the poor people out there that uses this format I feel sorry for you :)

    Trying to keep everyone happy is a waste of time and effort if they want my music then I am more than happy to hook them up but they will just have to deal with the fact that I use AAC(MP4). If they only use Media player then they are shit out of the luck and will have to install iTunes or Winamp(Would more push Winamp, I only use iTunes to rip and upload to my iPod).

    Merry Xmas!!!

    --
    "The most dangerous creation of any society is that man who has nothing to lose." - James Baldwin, American author