Posted by: qyot27 | May 23, 2009

All The Kids Are Right

Before I go any further, no I haven’t watched the first episode of The Melancholy of Haruhi Suzumiya S2 yet, although I have read the Bamboo Leaf Rhapsody section of the light novels.  I really need to get off my ass and read volumes 4-9…I kind of stalled after reading the first 3, and have been getting sidetracked by other tasks ever since.  Which is also the same reason I’ve not finished playing Kagetsu Tohya nor attempted to really start Fate/Stay Night.

Anyway, one of the things I recently got interested in was authoring DVD-Audio disks.  Not DVD-Video disks that have been fudged into being audio-only, but honest-to-goodness DVD-Audio (you know the AUDIO_TS folder on DVDs that always seems to be empty?  This is the reason it exists; pop the DVD side of a DualDisc into your computer and you’ll see my point – DualDiscs are usually either CD/DVD-Audio or CD/Hybrid-DVD setups, where ‘Hybrid-DVD’ is an easy way of saying both DVD-Audio and DVD-Video).

And there actually does happen to be an open-source solution here, in the form of DVD-A Author. However, it was a terror trying to figure out just what the heck I was doing wrong for a while. And after struggling with it for about a day or so, I finally figured it out, so I’m sharing this info for anyone else interested in the idea.

Why DVD-Audio, though? Well, it comes down to the technical aspects of audio, mainly. A normal Audio CD is supposed to adhere to something called the Red Book Standard, which specifies that the audio is stored as stereo, 44.1 kHz frequency, and a 16-bit depth precision in Linear PCM format (which most people know as ‘uncompressed’ audio). Not all CDs strictly adhere to Red Book, though – HDCDs are one example, along with CD EXTRA/Enhanced CD, or any Audio CD containing DRM or copy prevention measures. DVD-Audio discs, by contrast, allow a plethora of other channel/frequency/precision combinations, as you can see in this chart on Wikipedia. They also include provisions for using DRM in the forms of CPPM and Verance watermarking, the first of which has been overcome and the second of which only has a reference document describing how to overcome it. But for home-authored discs, that part shouldn’t matter.

Simply put, it allows a much more faithful reproduction of the audio signal – doesn’t necessarily mean that you can automatically hear the difference from a regular CD, but from a technical standpoint it preserves more of the original sound than a CD does, which is better in principle. If you’re an audiophile, then the difference probably can be heard, especially on high-end sound systems (one reference I saw was that DVD-Audio, or specifically 96kHz/24-bit, more closely preserves the sound from vinyl transfers). The one catch, is that the chart doesn’t make a point of showing which combinations are allowed by the formats that DVD-Audio supports, they list it further down in the paragraph instead – those formats are LPCM (the same format used on CD, although with the advantages I listed earlier), and Meridian Lossless Packing or MLP (which also forms the core of Dolby TrueHD; the main differences between regular MLP and TrueHD are mainly in the number of channels and maximum bitrate, and how robust secondary features like channel placement and metadata are). The big difference between LPCM and MLP in terms of DVD-Audio is that the higher the bit depth and frequency, the more likely it is that MLP is necessary – as quoted from the article, “In uncompressed modes, it is possible to get up to 96/16 or 48/24 in 5.1, and 192/24 in stereo. To store 5.1 tracks in 88.2/20, 88.2/24, 96/20 or 96/24 MLP encoding is mandatory.” (emphasis mine). In addition, while there is work on an open-source MLP encoder to be included in ffmpeg, it still isn’t bitstream-compatible (ffmpeg can decode it, but apparently nothing else can yet – also, ffmpeg output is limited to 16-bit, or at least I couldn’t figure out how to do 24-bit output when I tried), nor does DVD-A Author support MLP at this time. What this means is that you just can’t do super-high frequency surround sound yet (unless it’s 96/16, anyway). 5.1 is possible for 48/24 LPCM, though.

Now, with all that heavy technical stuff out of the way, we get to the much much simpler how-to. For this I do use the command-line, and it is easier if you’ve installed either the XP Open Command Window Here Powertoy or the Open Command Prompt Shell Extension. I also mention adding directories to Windows’ PATH, which can be done by going to Settings->Control Panel->System->’Advanced’ tab->’Environment variables’ button, and then scrolling down in the System variables pane until you reach the line that says Path. Click on that, and then click Edit. That will bring up a dialog where you can append a new directory to the end of the listing – entries are separated by semi-colons. Alternately, you can create a Path variable in the User variables pane so that it only applies to your user account. You may need to restart Windows Explorer or your computer after you modify your Path.

Anyway, here we go. Grab the necessary downloads:
FLAC 1.2.1b
DVD-A Author Package 09.02-2

1. Create directory C:\test\g1 (this a temporary directory; you can delete this after all is said and done)

2. Create directory C:\dvda (this a temporary directory; you can delete this after all is said and done)

3. Copy .wav files to C:\test\g1

4. Use flac -0 to convert .wav files to FLAC – this is to ensure the files are correct; the .wav files’ headers can sometimes be wonky and DVD-A Author won’t accept them. Converting to FLAC will solve this, since flac.exe will prune bad header info during the conversion and standardize the input files. Using Level 0 compression is mainly for speed, since these are only temporary files. It would help if you added C:\Program Files\FLAC to Windows’ PATH variable so that it can be run from any directory. You don’t need to specify an output file, flac.exe will output the .flac files in the same directory as the input files.

flac -0 01.wav

You can even batch script this part by typing the lines out in Notepad with each flac command on a new line, and then saving the file with a .bat extension. Then just double-click and it’ll convert them without any further user input.

I’d recommend deleting the .wav files after the conversion to FLAC is done.

5. In DVD-A Author GUI, navigate to C:\test\g1, select the .flac files, and add them to group 1 (groups can be used to separate stereo from surround versions, just add another group and place correct files in group 2 or so on; you can have a maximum of 9 groups, with 99 files per group). Using the Audio input button to specify a directory isn’t necessary – specifying the actual files is enough.

6. Navigate to C:\dvda and press the Output directory button.

7. Click the Encode button.

8. To compile the ISO, use this command-line with the version of mkisofs included with DVD-A Author (like with FLAC, it might be a good idea to add DVD-A Author’s directory to Windows’ PATH):

mkisofs -o output.iso -V volume_label -dvd-audio input_directory

So in my case, it would look like this (my test sample was the 96/24 Wave version of Nine Inch Nails’ The Slip*, which is available on the official website). Of course, the locations can be anywhere – I just used C:\Documents as an example.

mkisofs -o C:\Documents\NIN_THESLIP_DVDA.iso -V NIN_THESLIP_DVDA -dvd-audio C:\dvda

Now, you might be asking yourself why do it on the command-line when we were using the GUI a second ago. The simple answer to that is, the -V option (which tells mkisofs what the volume label should be); if we’d let the GUI create the ISO, the volume label would’ve been CDROM, which isn’t good for archival purposes. By doing it this way, you can specify what the disc should show up as when you insert it into your computer’s DVD drive.

*This is primarily the reason I converted to FLAC in the first place – apparently those .wav files have some non-standard data that DVD-A Author chokes on, in addition to the fact that they don’t have WAVE_FORMAT_EXTENSIBLE headers.  DVD-A Author is supposed to be able to open LPCM .wav files, but as I had problems with these files in particular, I feel the best course of action is to make the whole point irrelevant and convert them to FLAC first.

Also, as HCenc 0.24 beta has been updated, and one of the updates was the inclusion of an Auto IntraVLC function, I now include this in the 024 profiles.  Using *INTRAVLC 2 enables it, so all those *INTRAVLC 1 lines should be changed to 2’s.  I might decide to update and re-upload the profiles at some point in the future (more than likely when 0.24 reaches non-beta status), but for right now you’ll have to update the profiles yourself.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: