WebDVD
======

WebDVD is intended to provide a simple way of producing DVDs with
attractive and usable menus.  It converts HTML pages into DVD menus by
rendering them in Mozilla and reproducing their link structure.  This
allows you to design DVDs using familiar HTML editing tools or your
favourite text editor.  This very early version produces a set of
files suitable for passing to the "dvdauthor" and "spumux" programs,
but in future it is intended to run the necessary external programs
automatically.

Requirements
------------

WebDVD depends on the following software:

- Gtkmm 2.0
- Mozilla 1.7.x (later versions may work but are untested)
- Xvfb (from XFree86 or X.org)

To build a complete DVD image you will also need:

- dvdauthor
- mjpegtools
- mkisofs
- netpbm

You will also need a program such as ffmpeg or mencoder for producing
DVD-suitable MPEG-1 or MPEG-2 video files.

Usage
-----

Run "webdvd URL" where URL is the URL for the page that is to be the
top menu of the DVD.  It will automatically follow links to other
pages and to video files, rendering each page.  You must be careful
not to link to pages that you do not want to appear on the disc, such
as normal web sites.

By default, webdvd uses a frame size of 720x576, which is suitable for
PAL DVDs.  If you wish to produce NTSC DVDs you must override this
by adding the option "-geometry 720x480".

This will create the following files (with NNNNNN replaced with each
successive page number):

- webdvd.dvdauthor: This is an XML file to be passed to dvdauthor.
- page_NNNNNN.spumux: These are XML files to be passed to spumux.
- page_NNNNNN_back.png: This is a static image of the page, which
  becomes the menu background.
- page_NNNNNN_links.png: This is an image of the change in appearance
  of each link when the pointer is over it.

Currently, you must run commands along the following lines to produce
a complete DVD image:

for spumux in page_??????.spumux; do
    page=$(basename $spumux .spumux)
    pngtopnm ${page}_back.png                              \
    | ppmtoy4m -v0 -n 1 -F 25:1 -A 59:54 -I p -S 420_mpeg2 \
    | mpeg2enc -v0 -f 8 -a 2 -o /dev/stdout                \
    | mplex -v0 -f 8 -o /dev/stdout /dev/stdin             \
    | spumux -v0 -m dvd $spumux > ${page}.vob
done
rm -rf dvd-temp
dvdauthor -o dvd-temp -x webdvd.dvdauthor
mkisofs -dvd-video dvd-temp >dvd.iso
rm -rf dvd-temp

Adjust the name of the temporary directory (here "dvd-temp") and the
output file ("dvd.iso") as you please.

If you are using NTSC video, you will need to change the ppmtoy4m
parameters.  Use "-F 30000:1001 -A 10:11" instead of "-F 25:1 -A 59:54".

Limitations
-----------

Each page must fit within the frame - DVD players do not support
scrolling menus and WebDVD currently is not able to split them into
multiple menus.  Note also that the video frame is somewhat larger
than the visible area of a normal TV.  For this reason WebDVD applies
a stylesheet to all pages that adds 50-60 pixels of padding on all
sides of the body.

WebDVD sends a "mouseover" event for each link and sets it into its
"hover" state, then records how this changes its appearance.  This
change is then shown when the corresponding button on the DVD menu is
highlighted.  WebDVD applies a stylesheet which changes the colour of
text links in the "hover" state, but this has no effect on image
links.  You must ensure that image links are highlighted in an obvious
way when the mouse pointer is over them.

The DVD specifications limit each menu to having no more than 36
buttons.  In any case, it is poor design to have very large numbers of
buttons on a single menu.  WebDVD will warn you if you use more than
this number of a links on a page, and will ignore any additional ones.

The DVD specification also limits the overlays that are used for
highlighting of buttons to using no more than 4 colours.  WebDVD will
reduce link highlighting to 1 transparent and 3 opaque colours using
Floyd-Steinberg dithering, which is certainly good enough for
anti-alised text but may not be so good for complex highlighting.

Author and copyright
--------------------

WebDVD was written by Ben Hutchings <ben@decadentplace.org.uk>.
Copyright 2005 Ben Hutchings.

This software is based in part on the work of the Independent JPEG Group.
Copyright 1991-1998 Thomas G. Lane.  (This applies to the file jquant2.c.)
