Creating a "Wizard People, Dear Reader" DVD on Linux

I first became aware of Wizard People, Dear Reader via a post on the venerable Table of Malcontents blog. Here are the clips that they embedded in the post:

I'll wait here until you've taken a peek and become fanatical about it.

Go ahead, take your time.

Now, if you're like me, one of your first thoughts was, "How can I go about making a DVD of the first Harry Potter movie, with the WPDR audio as an alternate audio track?" You're probably not like me, but I'm going to tell you how to do so anyway.

I should note two things. ONE: I'm using the North American NTSC 16x9 release (the two-disc set). Any NTSC version should probably be fine, but there's some issues with PAL because of framerate differences. The Wikipedia article has some information about that.

TWO: The only data I'm serving from this website is my own dvdauthor creation files, which I've created entirely by hand (apart from the logo on the menu systems). In order to build this DVD, you'll have to have your own copy of the Sorcerer's Stone DVD, and you'll have to grab the WPDR audio from this site as well. Once you have those and follow these instructions, you should have a DVD with the following very plain, utilitarian menus:

Main Menu Scene Selections Audio Selection

Requirements

Data Requirements

Software Requirements

Additional Requirements

Additionally, if you're not happy with my DVD menus, or you just want to muck around with the actual DVD creation, you'll need to have a few more utilities to play around with all that (though most of them come with mjpegtools and dvdauthor, so you probably already have those from the first batch of programs). Here's what I used, though there's many ways of doing it:

The Procedure

  1. Preparation

    First off, you'll want to go grab the mp3 files from the actual Wizard People, Dear Reader homepage. Links to the files themselves (via archive.org):

    Just so that we're starting off on the right foot, here's how those files look to me. If you've got different filesizes or md5sums, etc, you'll want to make extra-sure that what I'm telling you will do the trick.

    file            size            md5sum
    wiz1.mp3        36583866        706c5a977e6be66d791c58f76f85f0c7
    wiz2.mp3        35453311        00d8ddb45bf1325315c6a8e943d22021
    The first number of steps are all audio processing tasks, so you can probably substitue your tools of choice for many of them.

  2. Convert the mp3s to wavs

    lame --decode wiz1.mp3 wiz1.wav
    lame --decode wiz2.mp3 wiz2.wav
  3. Bump up the volume on the first half

    I've found that a 2.5dB increase in volume is about right.

    normalize -g 2.5 wiz1.wav
  4. Combine the two files

    I used Audacity for all of this. First, pad the end of wiz1.wav until it's at 01:13:48.890 (I actually just used 01:13:49.000), and concatenate wiz2.wav at the end. Then fill the end of the file with silence until 02:32:12.000. In the end, your file should be 805,442,444 bytes (small variations in size probably don't matter).

  5. Resample to 48 kHz

    I used sox for this... There's a number of different resampling options, check sox's manpage for details (this page, linked from the manpage, has a bunch of detail on what the various modes mean). Personally I just used "polyphase" since that seemed to give the "best" quality, and I didn't care how long it took:

    sox wiz.wav -r 48000 wiz48k.wav polyphase
  6. Convert wiz48k.wav to AC3 Audio

    transcode -i wiz48k.wav -y null,raw -N 0x2000 -E 48000,16,2 -b 384 -m sound-wpdr.ac3
    My sound-wpdr.ac3 file was 438,336,000 bytes when it was done.

  7. Rip the video and audio streams from the DVD

    mplayer dvd://1 -dumpvideo -dumpfile video.m2v
    mplayer dvd://1 -dumpaudio -dumpfile sound-orig.ac3 -aid 128
    The "-aid 128" option will ensure that it's the english audio track you're grabbing. mplayer should output a list of available audio tracks as it starts up - feel free to pick and choose if you want, obviously, though my dvdauthor XML files assume that you've only kept the one english audio track. On my system, video.m2v is 6,157,880,136 bytes, and sound-orig.ac3 is 511,917,056 bytes.

    At this point, you should be able to get the following with the file command:

    sound-orig.ac3: ATSC A/52 aka AC-3 aka Dolby Digital stream, 48 kHz,, complete main (CM) 3 front/2 rear, LFE on,, 448 kbit/s reserved Dolby Surround mode
    sound-wpdr.ac3: ATSC A/52 aka AC-3 aka Dolby Digital stream, 48 kHz,, complete main (CM) 2 front/0 rear, LFE on,, 384 kbit/s reserved Dolby Surround mode
    video.m2v:      MPEG sequence, v2, MP@ML interlaced Y'CbCr 4:2:0 video, CCIR/ITU NTSC 525, 16:9, 29.97 fps
  8. Multiplex the video and sound streams

    mplex -f8 -o wizard_people.vob video.m2v sound-orig.ac3 sound-wpdr.ac3
    The end file, wizard_people.vob, came out to 7,249,399,808 bytes on my system.

  9. Create the DVD image

    Here's where my dvdauthor files come into play. Unpack the tarball and you'll see it creates a wizard_people directory. Move wizard_people.vob inside it. Inside wizard_people, you should see a whole bunch of menu_* files and another wizard_people directory. (If the wizard_people directory doesn't exist, create it). Then run:

    dvdauthor -x wizard_people.xml
    Once that's done processing, you should have an empty AUDIO_TS and a full-of-data VIDEO_TS inside the wizard_people directory. That's the DVD image! It would be a good idea to test it out before burning:
    xine dvd:///path/to/wizard_people/VIDEO_TS/
  10. Burn the image

    growisofs -speed=2 -dvd-compat -Z /dev/dvd -dvd-video -f -V HP_WPDR wizard_people
... and that's it! You're done.

Editing the DVD

You may think that my menus suck, or you want them to work differently, or perhaps you just wanted to poke around to see what everything in my tbz2 does. Briefly, here's what all the files are (and links to some of the text-based files, as well):

Files created by me

wizard_people.xml
This is the main dvdauthor XML file, containing all the code which runs the menus, etc. I imagine this may be useful to anyone who's not sure how to go about making a DVD with multiple audio tracks and scene selections, etc.
menus.xcf
This is a Gimp file which is used to generate all the menu graphics.
menu_*_background.pcx
These are the menus, minus any buttons. It's just a static image.
menu_*_buttons.png
These define the buttons for the menus. As far as I can tell, it needs to be a transparent image with only two actual colors. Button creation is one area of doing DVD authoring on Linux that I don't really understand well enough to do anything but the most incredibly basic tasks with.
menu_*_spumux.xml (example)
spumux needs this XML file to know how to stitch together the menus properly. All of the ones in here are identical except for the filename inside.
mkmenus.sh
This is just a little shell script which loops through all the menus that I need to create and runs the necessary commands to get them ready for dvdauthor.

Files created by mkmenus.sh

menu_silence.ac3
Two seconds of silence.
menu_*_background.m2v
These are two-second video clips without sound, where each frame is just the corresponding menu_*_background.pcx
menu_*.mpg
These are just menu_*_background.m2v which have had the silent audio track multiplexed in.
menu_*_final.mpg
These are the files which are ready for dvdauthor to use. They've taken menu_*.mpg and run it through spumux using the XML files, which in turn read in the menu_*_buttons.png files to know where to put the buttons.

Other Information

I originally used "dvdxchap -t 1 /dev/dvd" to determine where the chapter marks should go, but apparently there's some kind of bug in the version I was using, because it seemed to be calculating the chapter marks based on a framerate of 30fps, instead of 29.97fps. Over the whole course of the movie, that meant that the chapter marks were a little over eight seconds behind by the time the end of the movie came around. In order to actually use the values given by dvdxchap, I had to multiply its values by 1.001. That's something to check up on if you end up doing the same thing. It caused me quite a headache until I had it figured out for me on the dvdauthor mailing list.

Conclusion

Not much else to say, really. Feel free to let me know if you've got any questions or suggestions, etc.