Automated DVD Creation

Tried dvdwizard. This is written for PAL, so it has to be modified for NTSC. Here are the changes necessary:

  • Change references to the PAL size of 720x576 to NTSC, which is 720x480

  • Change the frame rate parameter of the ppm2y4m commands from -F 25:1 to -F 30000:1001

  • Change the default for the variable tvsize from 635×535 to 635x439

  • Change the expression let offsetY=(576-$tvY)/2+1 to let offsetY=(480-$tvY)/2+1

Of course, I ran into other trouble, too. dvdwizard complained thusly:

**ERROR: [ppmtoy4m] Bad Raw PPM magic!

**ERROR: [mpeg2enc] Could not read YUV4MPEG2 header: system error (failed read/write)!

The mpeg2enc error was caused by te ppmtoy4m error. The former is piped into the latter. So the problem was with ppmtoy4m.

It seems there are several formats of PNM (portable anymap) files, including PPM (portable pixmap–color), PGM (portable greymap) and PBM (portable bitmap–monochrome). These are simple formats, and each has its own “magic number” at the start of the file which identifies which format it is. There are two variants of each format, ASCII and binary. The headers for these are:

P1
ASCII PBM (monchrome)

P2
ASCII PGM (greyscale)

P3
ASCII PPM (color)

P4
binary PBM (monchrome)

P5
binary PGM (greyscale)

P6
binary PPM (color)

The files being generated by convert had a header of P3, but ppm2y4m wanted P6. So, how to make convert output binary instead of ASCII? If I converted from PPM to PNG and back, that seemed to work. But then, while trying to diagnose problems with the VMGM menu, I started seeing P5 headers. This was my own fault. Instead of a picture background, I used a solid grey so as to make button locations stand out. Convert assumed I wanted a PGM instead of a PPM. Oops.

Another problem was that the convert -trim command failed saying the geometry was zero-sized. I switched to a resize command (convert -resize) instead.

The last problem was with mogrify. For some reason, it complained it couldn’t create files. I switched from mogrify to convert. The only difference between these programs is that mogrify modifies the given file and convert puts it changes in a different file. So whereever mogrify was used, I made this kind of change: mogrify -option $maskPic2 to convert -option $maskPic2 png:${maskPic2}-tmp; mv ${maskPic2}-tmp $maskPic2. The png: prefix to the temporary file name is required because convert uses the file suffix to determine the format. Since I’m creating a file ending in -tmp, I have to specify the format with the prefix. Most of the changes are to PNG files, but a few are PPM. Yeah, this is the cowardly way to fix it, but grandma’s 96th birthday is less than a month away and I gotta get these disks done.