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?"
Just use it as an example to create scripts converting to other formats.
Robert
Bastard Operator From 193.219.28.162
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. :)
Go to this website:
http://www.hydrogenaudio.org/
(Read and search the site before asking any questions.)
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
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 :-)
Stick Men
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.
Flacattack is great. Configure a config file and Flacattack does the rest for you. Check out hydrogenaudio.org disuscussion on the lossless forum.
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.
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 scriptn verter.php
http://www.buberel.org/linux/batch-flac-to-ogg-co
Slashdot: Failed Car Analogies. Amateur Lawyering. Anecdote Battles.
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.
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