February 2004

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:

ASCII PBM (monchrome)

ASCII PGM (greyscale)

ASCII PPM (color)

binary PBM (monchrome)

binary PGM (greyscale)

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.


Comments (0)


Borked MPEGs

The damnedest thing happened. dvdauthor had trouble with four of the files I exported from Kino:

STAT: Processing movie-01-mar-2003.mpeg...

WARN: System header found, but PCI/DSI information is not where expected

(make sure your system header is 18 bytes!)

WARN: Skipping sector, waiting for first VOBU...

WARN: Skipping sector, waiting for first VOBU...

WARN: Skipping sector, waiting for first VOBU...


With a couple of them, dvdauthor crashed. With the others, it just stopped. I found if I re-exported them with the split option on, the trouble went away. But then I had multiple chapters for each video and the chapters="0" option didn’t seem to work.

So I tried to merge the parts together. Some information says you can cat them into one file, but others say that’s not good. mplayer played the catted file, but dvdauthor didn’t like it. I tried mpgtx. This is a tool to split and join MPEG files. Again, mplayer would play the file, but dvdauthor didn’t like it:

WARN: Skipping sector, waiting for first VOBU...

ERR: Audio pts moves backwards; please remultiplex input.

Finally, in searching for an answer I saw the -h option to mplex (which Kino uses as part of exporting). This makes mplex generate a system header in every pack rather than just in the first. This seems to fix the problem.


Comments (0)


DVD (Movie) Backup

I have youngin’s in the house who like to play with toys and gadgets. (I wonder where they get that from.) We’re on our second copy of the first Harry Potter DVD as a result of this “inquisitiveness.” This made me interested in DVD backups. The big problem here is DVD burners can create single layer (DVD-5) disks, which hold 4.7 GB, but many commercial disks are burned on dual-layer (DVD-9) media which hold twice a much. So the problem is how to squeeze all the extra bits on a DVD-5 disk? Here are some links to stuff I tried unsuccessfully:



DVD Transcoding Guide


dvd::rip (apt-get install perl-Video-DVDRip; dvdrip)

Automatically transcoding DVD-9 to DVD-5 or how to backup a dual layer movie DVD.

To be fair, dvdbackup worked just fine–I just couldn’t get the rest of the way there in Linux. I was still able to use the files dvdbackup ripped. What I finally ended up using to shrink the files is a Windows program (gasp!) called DVD Shrink. I backed up the movie using dvdbackup, copied it to a fat32 partition, booted W2K and ran DVD Shrink on it. This created a new DVD directory layout (AUDIO_TS/… and VIDEO_TS/…). Then I booted back into Linux and created the ISO and burned the disk

mkisofs -dvd-video -udf -o /mnt/edit/shrunken.iso /mnt/dosedit/dvd-shrunken/

growisofs -dvd-compat -Z /dev/dvd=shrunken.iso

The disk played fine on the computer but was refused by both the standalone players in the house and my Thinkpad’s (1999 vintage i1472) DVD player. Once I realized that the DVD files were all in lower case (thank you, Windows), I upper-cased them, rebuilt the ISO and burned another disk which worked fine. I now am the proud owner of my first DVD+R coaster!


Comments (0)


DVD Menus

I’m in the process of converting my movies from mini-DV to mpegs for use with DVD Author. In the mean time, it’s time to assemble a DVD menu. Anders Dahnielson has a tutorial on this. He requires toolame as part of it. Rick Harris also has a tutorial.

To test menus with xine:

xine dvd:/path/to/dvd/dir/

Don’t forget the trailing slash, or xine will barf.


Comments (0)