Friday, November 30, 2012

Extracting WAVs from VOB Files

The Station to Station box set contains a DVD with hi-resolution digital rips of the album, including one in 96/24. Since I play all of my digital stuff through a Logitech Transporter, I needed to rip those files to the media server. Here's how I did it.

First, I used mplayer to rip the VOB files from the DVD. These files have trivial video in them, so that has to be removed. The command to do that is:

ffmpeg -i <infile.vob> -acodec pcm_s24le <outfile.wav>

The audio codec here is the usual one for 24-bit audio, as you can see if look at a wav generated from a flac file. E.g.:

# ffmpeg -i 01-statesboro_blues.wav
...
Input #0, wav, from '01-statesboro_blues.wav':
Duration: 00:04:19.94, bitrate: 4608 kb/s
Stream #0.0: Audio: pcm_s24le, 96000 Hz, 2 channels, s32, 4608 kb/s
At least one output file must be specified


Note that this is independent of the sampling rate, so it works for 48/24 files, as well.

So now I had a bunch of 96/24 wavs, which I could convert to flac in the usual way.

Monday, November 19, 2012

Perl Filters

A nice trick for easily writing Perl filters:

perl -pe 's/a/b/g'

will do the substitution on each line of input and spit it back out. And:

perl -i bak -pe 's/a/b/g' file1 file2....

will do the same, except it will change the given files and back them up to file1.bak, etc, as it does so.