Slashdot Mirror


Automated MP3 Ripping?

jimiUK asks: "I've been working for a while on my streaming mp3 server, using Apache:MP3 running on FreeBSD to start with but now running on RedHat Linux. It all runs smoothky, but what I'm trying to do is automate the ripping process so I can just insert cd's and have them ripped and classified automatically. This box is a dedicated server without a keyboard or moniter connected so I'd rather have no user input whatsoever. I've solved all of the initial problems, and now have the box set to login automatically on boot up, but I still can't find the right script. The most useful has been autorip, and I've also tried ripit (although it requires user intervention). My main problem is that if autorip cant find the cd information, it just stalls. My Perl skills are non-existent really so i'm not sure how to alter the script to instruct it to rip away if it doesnt find track info, which I could add in later. Does anyone have any other suggestions for alternative script front ends, or can point me in the right direction on altering autorip to get it over this hurdle." For those of you running MP3 servers, this idea might be a huge timesaver. Has anyone implemented such a system?

32 comments

  1. iTunes (Re:AudioCatalyst) by Anonymous Coward · · Score: 1

    I've used SoundJam and iTunes to autorip MP3s. They rip, encode, and name (via CDDB) at 2x-3x on my (fairly old) PowerMac. Pair that up with Apache (on MacOSX) or any one of a number of Mpeg streaming servers and your good to go.

    Oh, but wait, it's not open source, free, and it doesn't run under linux (or even on X86 hardware) so don't even consider it.

    Mod me as -1 Flamebait or +3 Informative

    1. Re:iTunes (Re:AudioCatalyst) by toast0 · · Score: 1

      will your fairly old powermac run os x?

      i thought you needed a g3... well at least to install

      apple's A/UX will run on some power macs though... as long as you don't mind system 7.0 :)

    2. Re:iTunes (Re:AudioCatalyst) by toast0 · · Score: 1

      ooops no i was confusing what i read about A/UX :)

      sorry my fault

  2. abcde and otto are my friends by Anonymous Coward · · Score: 2

    Check out

    A Better CD Encoder (abcde)

    and

    Otto

    I'm doing exactly what you describe with a spare laptop that had it's keyboard mangled.

    I created a supervise/svscan job to monitor the CDROM and tun abcde if it finds a CD, which allows me to insert a CD and have the laptop eject the CD when it's done ripping.

    Complete directory structure support for title/artist info.

    freedb and cddb support.

    otto then lets me play the new mp3s, and it makes life easier by managing them in mysql. I'd be happy to pay for abcde and otto, someone took the time to tie a bunch of tools and funtionality into a practical interface.

  3. Re:But what do you WANT it to do? by bonehead · · Score: 1

    My autoripper goes ahead and rips the disc with generic track names, but goes a step further.

    Once a day, it will attempt to lookup the track names again, once they appear in freedb, the tracks get named and stored appropriately.

  4. Re:But what do you WANT it to do? by bonehead · · Score: 1

    Sorry, it's part of a larger project which I'm not free to redistribute.

  5. Re:How about playing while ripping? by HeghmoH · · Score: 1

    Apple's iTunes does this, so it's obviously possible. Doing it with command-line tools may not be easy, though.

    --
    Mod down posts with a "Free Mac Mini/iPod" sig, they're spam!
  6. Re:The script I use... by Greg+W. · · Score: 2
    $_ = $track->name;
    s/\W/_/g;
    $title = $_;

    I foresee a problem here. The song title may contain a slash or other "naughty" character that isn't whitespace. Now, on Unix file systems, the slash is the only show-stopper, but I've heard complaints from Windows users that the question mark causes tremendous grief.

    Just like when you write a CGI that accepts user input from a URL, your CDDB lookup is relying on outside information. Rather than stripping out a subset of characters that you know to be undesirable (whitespace in your case), you need to take the more proactive approach -- only allow characters you know you want, and clobber all the rest.

    Also for what it's worth: I prefer cdparanoia for ripping, and I'd put the encoder and its options up at the top of the script where they can be configured more easily.

  7. Re:How about playing while ripping? by JabberWokky · · Score: 2
    Is this possible?

    On the Windows side, Musicmatch does it, and on the Mac side, the default iTunes does it. Also, since you can display visualization for CDs, the data is being read at the same time it is playing... it's one more step to encode (hey! how about a "visualization" plug-in that encodes? I'm not sure if all data is fed to the plugins, though...)

    If you're using a nice Multitasking OS, why not just write a script that starts encoding (you'd have to make sure it writes to the final files directly, and not some intermediate file), forks, and pauses 2 seconds, and starts playing the files by chronological order, starting with a date one minute in the past. Each time a song finishes, regenerate the playlist to reflect new songs that have been encoded, and progress through them. Then, you can be done encoding, and have it prompt you for another CD, even before the first has finished playing.

    It doesn't even require perl - a simple bash script with find, plaympeg and your encoder of choice (abcde seems to be recommended) could easily accomplish this.

    --
    Evan

    --
    "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
  8. Re:AudioCatalyst by joekool · · Score: 1

    but most especially, it's not automatic on a headless box

    --

    Slackware: old school feel, new school gear.
  9. Re:Abcde by rcw-work · · Score: 1

    Email the compile errors to me (not just the "make : *** [target] Error 1" stuff please) and I'll see if I can help.

  10. Re:Abcde by rcw-work · · Score: 1

    It needs to be run after the cd is in. It has no "waiting state". I'd recommend running it from something like autorun.

  11. Re:How about playing while ripping? by rcw-work · · Score: 2

    What I usually do with abcde is generate a playlist (which is created before any of the tracks are read), wait for one or two tracks to encode, and then play the list in any playlist-capable player. By the time the player gets to the next track, that track would have finished encoding.

  12. Abcde by rcw-work · · Score: 3
    abcde 1.9.x can do non-interactivity and you can even add all the track titles when you're done if there's no CDDB entry. Plus there's Ogg support, you can format the filenames any way you please, and you can use other machines for remote encoding.

    Disclaimer: I wrote abcde.

    1. Re:Abcde by locutus074 · · Score: 2
      First, thank you for writing abcde. I love it. :)

      I think that for what the person wants, he should set up an auto-mounting daemon, but have it run abcde instead of mounting the CD. Just a thought.

      --

      --

      --
      We have fought the AC's, and they have won.

    2. Re:Abcde by haplo21112 · · Score: 1

      Greatest program ever! One problem though, I recently changed from stampede .89 distro(It was very out of date .90 didn't work, and my box was becoming non-useful) to mandrake 8, and I can't get id3v2 to compile at all. Not all bad I can still make .ogg files, has anyone had compile problems with id3v2, or know where I can get it in binary?

      --
      Power Corrupts,Absolute Power Corrupts Absolutely, leaving one person(group)in charge is absolutely corrupt.
    3. Re:Abcde by jimiUK · · Score: 1

      so if i set abcde up to run on login, will it sit and wait for a cd to be inserted, or does it need to be run after the cd is in. also does it return to the waiting state once a cd has been ripped ?

  13. Re:But what do you WANT it to do? by dubl-u · · Score: 2

    You mention that Autorip stalls when it can't find the CD info... how would you prefer it worked? Unfortunately, without a display, the only option would be to silently eject the disc so you can go on to the next, and you'd never know that that disc didn't RIP.

    Were I doing this kind of bulk ripping, I'd want it to rip the disc and put the files aside in a special directory. Then I would come back at the end of the day and enter the track info in a big batch. That way I could feed it disc after disc without thinking about it until I was ready.

  14. Good CD-ROMs for ripping? by dubl-u · · Score: 2

    The CD-ROM drives I have on my desktop are all awful for ripping; in particular, they are slow, error-prone, and woefully intolerant of scratches. One is so lousy that it will take 3 hours to rip a 45-minute CD.

    Happily, one of them just died, so I'm looking for a replacement. What EIDE CD-ROMs are best for ripping? Or are they all equally good these days?

    1. Re:Good CD-ROMs for ripping? by artbermas · · Score: 1

      Try the TEAC 60X CD-ROM. Never, never buy a Creative

    2. Re:Good CD-ROMs for ripping? by ConsumedByTV · · Score: 2

      Kenwood 72x drives are the best.
      I can rip at very very fast speeds (think under 5 minutes for a full disc) or at 3x in secure mode. Secure mode is a special feature of Exact Audio Copy that helps to make perfect cd rips by compairing data and other special stuff :).


      The Lottery:

      --


      "Not my manner of thinking but the manner of thinking of others has been the source of my unhappiness." - M
  15. Re:VNC on the headless box by toast0 · · Score: 1

    vnc is a bit of overkill...

    (open)ssh will do the same task just as welll

    and if needed... you can do X11 forwarding over ssh

  16. The script I use... by StressedCoder · · Score: 2
    Here is the script I use. Works well, but no eror handling. Fairly straight forwards, you will need libcdaudio, p5-MP3-info, and p5-AudioCD from ports/audio

    #!/usr/bin/perl
    #By Jason Denton, Copyright 2001


    use Audio::CD ();
    use MP3::Info;

    $cddev = '/dev/acd0c';
    $cd = Audio::CD->init($cddev);
    $info = $cd->stat;
    $cddb = $cd->cddb;
    $data = $cddb->lookup;
    $_ = $data->artist;
    s/\W/_/g;
    $artist = $_;
    $_ = $data->title;
    s/\W/_/g;
    $album = $_;
    $genre = $data->genre;

    $tknm = 1;
    $year = 2001;
    foreach $track (@{$data->tracks($info)}) {
    $_ = $track->name;
    s/\W/_/g;
    $title = $_;
    $mp3name = "$artist\_$album\_$title.mp3";
    `cdda2wav -D /dev/acd0c -I cooked_ioctl -s -b 16 -x -t$tknm $album$tknm.wav`;
    `lame -m s -b 160 -h $album$tknm.wav $mp3name`;
    `rm $album$tknm.wav`;
    `rm $album$tknm.inf`;
    set_mp3tag ($mp3name, $title, $artist, $album, $year, "", $genre,$tknum);
    $tknm++;
    }

    --
    Jason Denton Colorado State University [Thoughs and comments are my own, and not reflective of CSU]
  17. Re:You hackers are so lazy. by Trebuchet · · Score: 1

    If you are going to troll, at least put some effort into it.

    Malcolm solves his problems with a chainsaw,

    --

    Malcolm solves his problems with a chainsaw,
    And he never has the same problem twice.
  18. VNC on the headless box by 4/3PI*R^3 · · Score: 1

    If your box is sitting on a network, try installing VNC.
    I have several small networks that I support and I mostly use Linux on the servers and firewalls. Since I don't always have a monitor and keyboard that I can dedicate to a machine that is rarely used by a person (and usually stuffed into a closet somewhere), I install VNC and have it run on boot.
    This will not solve your problem with how to auto-rip MP3's, however if your MP3 server goes down or stalls for some reason, you can just VNC into the machine and see what is happening and fix it.
    Or perhaps this will solve your problem, since now you can have "user input" from any machine on your network.

  19. Lego Mindstorms... by affegott · · Score: 1

    The solution to your problem is Lego Mindstorms and a nice script. (Posted earlier). Just build a little robot to load and unload the CD's from the tray, and then rip and repeat.

    Sounds like a fun weekend project. You could have it queue up hundreds of CD's... and let it rip. (Pun intended)

    This was posted some time ago...

    Lego DJ thing

  20. How about playing while ripping? by mini+me · · Score: 3

    I would like to extend this question by asking if it is feasible to rip and play at the same time? I don't see why not if you are ripping at >1x but has anyone ever managed to do this?

    What I was wanting to do is to be able to pop in a CD, listen to it, and when I'm done listening to it, it will be archived in my MP3 collection for easier listening later.

    I really haven't done much CD ripping though, so I'm no expert on the subject. Is this possible? Are there any tools out there that allow this (while still allowing the automated ripping like the origional poster asked)? Or can the music be ripped/encoded fast enough that the MP3 can just be listened to as it is being ripped? Anyone have any solutions?

  21. I use Grip by -benjy · · Score: 3

    I like Grip. This GPL program can be configured to rip+encode CDs upon insertion and will eject them when done ripping (encoding is a separate process which can be queued up for later since it takes longer than ripping). You can choose from several encoders and the CDDB info is automatically collected. If you install the companion program, Digital DJ, the CDDB info will be shoved into a MySQL database for easy music management/playlist manipulation later on.

  22. Re:But what do you WANT it to do? by bobthemonkey13 · · Score: 1

    You could produce a tone through the PC speaker untill the user ejects the cd, or for a specified amount of time.

  23. But what do you WANT it to do? by MadCow42 · · Score: 2
    You mention that Autorip stalls when it can't find the CD info... how would you prefer it worked? Unfortunately, without a display, the only option would be to silently eject the disc so you can go on to the next, and you'd never know that that disc didn't RIP.

    If missing discs completely is acceptable to you, it would probably be very simple to hack the Perl scripts. I'm sure there's other hackers out there like me that would be happy to take a look at it. However, consider the above carefully first.

    MadCow.

    --
    I used to have a sig, but I set it free and it never came back.
    1. Re:But what do you WANT it to do? by jimiUK · · Score: 1

      yeah, that's exactly what i want to do - have it rip with generic names then continue to look up periodically. can u post or send me the code ?

  24. AudioCatalyst by tweakt · · Score: 1

    I'd highly recommend AudioCatalyst 2.1 from Xing
    (Actually now owned by RealNetworks)...$30 or
    so. Works great, rips, encodes and names (via CDDB)
    at 8x in one pass on my box.

    Oh, but wait, it's not open source, free and
    it doesnt run under linux so dont even consider
    it... Sheesh.