Batch Converting Between Formats? 94
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?"
sounds like a job for (Score:5, Insightful)
Indeed (Score:2, Informative)
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 :-)
just a simple frelling script. (Score:5, Informative)
Just use it as an example to create scripts converting to other formats.
Robert
Re:just a simple frelling script. (Score:2)
Use mencoder (Score:1)
Re:Use mencoder (Score:1)
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.
Re:Use mencoder (Score:1)
#!/bin/sh
for file in *;
do mencoder $file OPTIONS
done;
Re:Use mencoder (Score:1)
In other words, spaces in a filename kill this simple loop.
Re:Use mencoder (Score:1)
Konqueror + kio_audiocd (Score:2, Interesting)
Check this [linuxtoday.com] out.
Re:Konqueror + kio_audiocd (Score:2)
Re:Konqueror + kio_audiocd (Score:1)
Re:Konqueror + kio_audiocd (Score:2)
Re:Konqueror + kio_audiocd (Score:2)
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.
A summary (Score:4, 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. :)
Re:A summary (Score:1)
Re:A summary (Score:3, Interesting)
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 th
Re:A summary (Score:2)
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
One thing I have wanted to use (Score:2, Interesting)
gstreamer (Score:1)
Why? (Score:4, Insightful)
Why not just rip to high-quality MP3 and have done?
Re:Why? (Score:3)
Maybe because that wouldn't make for a particularly interesting Ask Slashdot.
Re:Why? (Score:3, Insightful)
MP3 Will Live Forever (Score:3, Interesting)
The bottom line is this: is there any digital mus
Re:MP3 Will Live Forever (Score:1)
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 real
Re:Why? (Score:2, Insightful)
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 devic
Re:Why? (Score:2)
Re:Why? (Score:2)
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 h
Re:Why? (Score:1)
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 b
Re:Why? (Score:2)
Hell, for $100 bucks of HD space, I could image over 200 of my CDs right now.
Re:Why? (Score:2)
Add two zeros for mp3 or ogg...
Re:Why? (Score:3, Insightful)
Re:Why? (Score:2)
Re:Why? (Score:1)
You need a seperate tool? (Score:1, Offtopic)
Re:You need a seperate tool? (Score:2)
Maybe you're right, and he should just find a better player - I don't think it's Foobar though.
Re:You need a seperate tool? (Score:2)
(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
Re:You need a seperate tool? (Score:1)
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 heirar
Re:You need a seperate tool? (Score:2)
For single artist albums:
For multi artist albums:
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.
Re:You need a seperate tool? (Score:1)
Re:You need a seperate tool? (Score:3, Informative)
That will add the "Artist - " in front of the song titles and stick them under Compilations, if they ar
Re:You need a seperate tool? (Score:2)
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
Re:You need a seperate tool? (Score:2)
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 t
Re:You need a seperate tool? (Score:2)
Re:You need a seperate tool? (Score:2)
The Master Of Audio (Score:3, Informative)
http://www.hydrogenaudio.org/ [hydrogenaudio.org]
(Read and search the site before asking any questions.)
Makefile (Score:5, Interesting)
make ogg
make mp3
make wma
make rip
Something alont those lines...I'll leave the Makefile as an excersize for the reader :)
Re: Makefile (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
Re: Makefile (Score:2)
> > 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!
The script I use... (Score:4, Informative)
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 [pattern.net]
Re:The script I use... (Score:1)
Re:The script I use... (Score:1)
Why? No, you don't. (Score:5, Insightful)
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.
Re:Why? No, you don't. (Score:2)
jRiver Media Center (Score:2)
http://www.musicex.com/mediacenter/ [musicex.com]
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
Flighty (Score:2)
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.
Re:Flighty (Score:1)
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 192kb
Re:Flighty (Score:2)
Re:Flighty (Score:2)
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.
Cool idea (Score:5, Interesting)
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.
Re:Cool idea (Score:1)
Re:Cool idea (Score:3, Interesting)
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
Re:Cool idea (Score:2)
ext4 maybe?
Re:Cool idea (Score:2)
Re:Cool idea (Score:1)
Re:Cool idea (Score:2)
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.
Re:Cool idea (Score:2)
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
etree scripts (Score:1)
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).
What about wav2mp3/wav2ogg? (Score:2, Informative)
I needed a command-line batch converter so I wrote one and posted it on sourceforge [sourceforge.net]. Check out: http://wav2mp3.sourceforget.net/ [sourceforge.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 [sourceforge.net] 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.
EAC with FlacAttack (Score:1, Informative)
Smart choice with FLAC! We learned the hard way! (Score:4, Informative)
But then... digital distribution [cdbaby.net] 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 [sourceforge.net] 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 [pattern.net] is a great Perl solution. I posted my audio-converter scripts here [oreillynet.com], which include the use of SOX [sourceforge.net] 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.
Re:Smart choice with FLAC! We learned the hard way (Score:2)
Some time ago, I proposed [sourceforge.net] 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?
Re:Smart choice with FLAC! We learned the hard way (Score:2)
Exactly my thoughts... (Score:3, 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/ [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.
Re:Exactly my thoughts... (Score:2)
Re:Exactly my thoughts... (Score:2)
Re:Exactly my thoughts... (Score:2)
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.
Re:Exactly my thoughts... (Score:1)
Here's two scripts to do what you want (Score:3, Informative)
Hand it a playlist, and it'll convert the files in that playlist to MP3 format.
http://perlmonks.thepen.com/401680.html [thepen.com]
Batch recursive FLAC to Ogg conversion scriptn verter.php [buberel.org]
http://www.buberel.org/linux/batch-flac-to-ogg-co
etree-scripts / shn2mp3 (Score:2, Informative)
Re:etree-scripts / shn2mp3 (Score:1)
etree-scripts.sourceforge.net [sourceforge.net]
if you use Windows...foobar 2000 (Score:2)
On the fly conversion via a samba plugin (Score:2)
http://file-ext-map.sourceforge.net/
It's a Samba 2.2 virtual file extension.
So you can save a bunch of
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.
Watch folder with distributed encoding? (Score:2)
Lossless audio is the way to go. (Score:2, Interesting)
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
FLAC advantages over WAV? (Score:1)
Re:FLAC advantages over WAV? (Score:1)
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.
Or you could stick to one format (Score:1)
Trying to keep everyone happy is a waste of time and effort if they want my music then I am mo