Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
News

Automated MP3 Ripping? 32

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?
This discussion has been archived. No new comments can be posted.

Automated MP3 Ripping?

Comments Filter:
  • by Anonymous Coward
    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
  • by Anonymous Coward
    Check out

    A Better CD Encoder (abcde [lly.org])

    and

    Otto [cardhouse.com]

    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.
  • 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.

  • Sorry, it's part of a larger project which I'm not free to redistribute.
  • Apple's iTunes does this, so it's obviously possible. Doing it with command-line tools may not be easy, though.
  • $_ = $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.

  • 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

  • but most especially, it's not automatic on a headless box
  • Email the compile errors to me (not just the "make : *** [target] Error 1" stuff please) and I'll see if I can help.
  • It needs to be run after the cd is in. It has no "waiting state". I'd recommend running it from something like autorun [sourceforge.net].
  • 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.
  • by rcw-work ( 30090 ) on Wednesday May 16, 2001 @01:07PM (#219046)
    abcde [lly.org] 1.9.x [lly.org] 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.

  • 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.
  • 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?
  • 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
  • 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 :)
  • ooops no i was confusing what i read about A/UX :)

    sorry my fault
  • 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++;
    }

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

    Malcolm solves his problems with a chainsaw,
  • If your box is sitting on a network, try installing VNC [att.com].
    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 [att.com] 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.
  • 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 [lego.com]
  • by mini me ( 132455 ) on Wednesday May 16, 2001 @03:31PM (#219056)
    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?
  • 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.

    --

  • by -benjy ( 142508 ) <benjy@nosPAM.alum.mit.edu> on Wednesday May 16, 2001 @07:43PM (#219058)
    I like Grip [nostatic.org]. 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 [nostatic.org], the CDDB info will be shoved into a MySQL database for easy music management/playlist manipulation later on.
  • Try the TEAC 60X CD-ROM. Never, never buy a Creative
  • 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?
  • You could produce a tone through the PC speaker untill the user ejects the cd, or for a specified amount of time.
  • 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.

  • 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:
  • 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.
  • 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 ?
  • 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 ?

What is research but a blind date with knowledge? -- Will Harvey

Working...