DVD Authoring Howto


Author
Todd A. Lyons <todd@mrball.net>
01 August 2004
Revision 0


Intro
This HOWTO aims to explain how to create a DVD that your standalone
DVD unit can properly play.  This HOWTO assumes you will make one
purchase that will make the entire process very easy.  The pivotal
piece of equipment is a Canopus ADVC-100 (http://dv411.com/advc100.html).
This device will take an analog input and do a raw video capture and
push it out a firewire port.  Incidentally, the ADVC-100 can also
convert in the opposite direction, though we won't need that here.  
It's a fantastic piece of equipment.  It's so good tha the local 
skydiving windtunnel uses one to create DVD's of your video in the 
tunnel.  It is highly unlikely that they're using Linux to d this, 
but with some scripting, it would be possible.


Program Requirements
If you have program versions less than any of these, this HOWTO
will not work.  It will fail with strange or cryptic error messages.
Please make sure you are running all current versions of these
softwares.
   dvgrab 1.5
   mjpegtools 1.6.2
   dvdauthor 0.6.10
   QDVDAuthor 0.0.7


Steps
 1) Have a large partition set aside for temporary storage of the
    raw video files.  On my system, I have a 200 GB drive mounted
    at /pvr.  All examples in this HOWTO will use /pvr as the
    base directory.
 2) Use dvRecord to capture the video.  It takes two arguments:
         dvRecord {minutes} {filename}
 2a In my case, I'm dubbing a 60 minute show using the Canopus
    ADVC-100, so I run:
         dvRecord 61 yoga_12
    It will create a directory named /pvr/yoga_12.  The first 
    video file will be named yoga_12_001.avi, the second will be
    yoga_12_002.avi, etc.  Each file will be 1 GB, approximately
    4.5 minutes apiece.  One hour of video will be a little over
    13 GB in raw video.  You need to be root to run this since 
    it uses nice to set the priority.  You can do this as a
    regular user too, but without the nice setting, you might
    get unsatisfactory results.  Look at the sample dvrecord.png
    to see what a typical cpature session looks like.  When the
    capture session is finished change the ownership of the
    files to whatever user you want to do the rest of the steps
    as.  Being root is not required for any further steps.
 2b FUTURE: Using a standard capture card, you would use mplayer
    to capture the video in a format suitable for using kino to
    assemble it.
    Approximate time: 61 minutes.
 3) Use kino to assemble the video.  It may be as simple as loading
    all of the raw video files.  If you don't have to remove any
    commercials or edit the content, all you need to do to complete
    this step is to save the project file as an eli file.  In my
    example, I captured a Yoga show from cable.  The steps are
    are based this scenario.  Load all of the video files for the
    capture project.  I found the best method was to open the last
    file first.  Look at the sample kino-add-file.png to see that I
    added the last file first.  Then use the "Insert File Before
    Frame" function and insert the previous file.  In the same
    screenshot, you can see that I imported 014 first, then 013 is
    the next file to import.  Look at the sample kino-all-files.png
    to see the fully loaded project (all the icons in the 
    storyboard pane on the left.  Now we want to edit out
    the commercials.  You can drag the time marker across the full
    time bar and kino will show you the frame at the current time
    marker.  When you get close to the point you want to make the
    edit, you can press the play button to see the video/audio.
    Press the Pause button (Play toggles pause too).  Then use the
    frame forward or frame reverse buttons to find the exact spot
    that you want to trim to.  Use the "split before scene"
    function.  Repeat this to find the end of the commercials.  
    Select the scene you just split by either draggin the time
    marker into the middle of the scene or by selecting it using
    the storyboard icons on the left.  This can be difficult to
    verify that you are deleting the desired scene if
    your split points are a black screen.  Personally, I use the
    drag time marker method.  Use the "cut" function to delete the 
    scene between the two split points.   Repeat this for all
    scenes you want to remove.  You could, if you wanted, also
    insert effects such as fades, wipes, blanks using the Kino FX
    tab if you like.  It's too much work for my needs, but you may
    find it very useful and aesthetically pleasing.  Save the 
    project file with the File->Save function.  Give it a name 
    with the extension .smil.  Then save the project file with 
    File->SaveAsELI to save it with the extension .eli.  Look at 
    the sample kino-save-eli.png for how I do it.  I save both 
    project files in the same directory as the raw video files.  
    The .smil file is used only if you ever need to reopen it in 
    kino.  The .eli file is the more important of the two because
    the next step requires a control file in eli format to work 
    properly.  In my example, I saved it as 
    /pvr/yoga_01/yoga_12.eli.  Look at kino_finished.png to see 
    the finished project.  Note that the time markers which showed
    the spaces between the files are now varying lengths.  This is 
    because the time marker shows only the edited chunks.
    Before exiting Kino, let's make a background for our DVD menu.
    The easiest way to do this is to find a frame that you like.
    Click the Export tab, then Stills tab.  The picture will go
    away, but you can be confident that is the frame that you are
    working with.  Change the "Frames of" setting from "All" to 
    "Current" so that it will only save the one frame in a JPEG
    format.  Look at the sample kino-export.png to see how I save
    this JPEG.  Even though I specified yoga_background.jpg as the
    filename, it actually saved it as yoga_background_00000496.jpg
    apparently including the frame number in the filename.  It is
    ok, it doesn't hurt anything.
    Approximate time: 10-15 minutes
 4) Use dv2mpg to create the mpeg2 format video file.  It does this
    in three steps.  It creates an audio file by reading the eli
    file and extracting the audio from the raw video files.  Look
    at the sample dv2mpg-command.png to see the command being
    instantiated and the files available to it.  Then it creates a 
    video file by reading the eli file and extracting the video 
    from the raw video files.  Look at the sample dv2mpg-command2.png
    to see the output of the video encoding.  It is much more
    verbose than the audio encoding.  In both of these steps, it
    uses the eli project file to know when to start/stop, according
    to your editing choices during kino.  The last thing this script
    does is multiplex this audio and video together into a single 
    peg2 format video file.  The script encodes at a rate of 6000 
    Kbits/sec.  At this rate, you can get about 85 minutes of video
    onto a standard DVD-R, which is just enough for two episodes of 
    the average 1 hour TV show (American) minus the commercials.
    Approximate time: 5.5 hours on my AMD Athlon 1.1 Gig SCSI box.
    (Your time will be dependent upon your CPU and disk throughput.)
 5) Use QDVDAuthor to generate the menus for your DVD.  The first
    step is to configure a background.  In my example, I used Kino
    above to save a still frame in JPEG format.  Click the "Add
    Background" button, browse to the directory where the JPEG is
    saved, and select it.  The saved image will appear in the tab
    named "Main Menu VMGM".  If you use another image that is not
    exactly 720x480 resolution, it will prompt you to scale it to
    fit.  Just click Yes and agree to everything.  Look at the
    sample qdvdauthor-background.png to see a basic backgroun that
    has been loaded.  Now click the "Add Movie" button and select
    the MPEG file generated by the dv2mpg script.  Repeat if you
    will be putting more than one MPEG per DVD.  Make sure to not
    exceed the free space for a blank DVD, about 4.4 GB.  In my 
    example, I am putting two shows per DVD.  Look at 
    qdvdauthor-movie.png to see the two movies that are now 
    available.  Next we're going to create a text label which will 
    become a button.  Right click on the background and select 
    "Add Text".  Click and drag to select the area you want the 
    text to be.  When you let go of the mouse
    button, it will bring up a text box dialog.  Select the font,
    size, and alignment.  Enter the text in the bottom box and press
    OK.  Repeat for each MPEG, but of course a different location
    must be selected for each block of text.  Look at the sample
    qdvdauthor-text.png to see what it looks like when adding a text
    label.  Next right click on the text label and select "Define as
    Button".  Give it a name, any name will do.  In my example, I 
    used "Show11" and "Show12".  Leave the action set to "Jump", set 
    the target to one of the MPEG's that are available, and press 
    OK.  Look at the sample qdvdauthor-button.png to see configuring
    a button.  Repeat for each MPEG you have in your project.  You
    could also set the color of the text when it's "selected" and
    when it's "activated".  Feel free to experiment, but note that
    the defaults are very good selections.  Next select Tools->Setup
    and set the Project Name.  You can set this to whatever you want
    it to be.  I use something very simple such as "Yoga DVD 1".
    Set the DVD directory to the final location that the DVD files
    and directory structure will be created.  In my example I use 
    /pvr/dvd1.  Make sure this directory is on a partition large
    enough to hold the approximate 4.4 GB worth of files (though it's
    not necessary for the directory to exist yet).  I also change the
    temporary directory.  Select the Paths tab and change /tmp to a
    temporary directory on your system that is on a partition large
    enough to hold all of the temporary files.  In my example, my
    /home partition is a large partition, so I set it to 
    /home/todd/tmp.  Press OK to accept the settings.  At this point,
    save the config file.  Click File->Save and create the directory
    you set in the DVD directory setting above.  Then in that
    directory save the file with an xml extension.  In my example, I
    named it /pvr/dvd1/yoga_11_12.xml.  At this point, you click the
    Create DVD icon or select DVDAuthor->CreateDVD.  A dialog box
    will appear which has all of the commands that it is about to
    run to create your DVD structure.  Look at the sample
    qdvdauthor-createdvd.png to see what the dialog will look like.
    Click OK to begin.  A status window will appear showing the
    individual parts of the DVD being assembled into the proper
    files and formats and locations.  Look at the sample
    qdvdauthor-processing.png to see sample output.  When the
    processing finishes, it will automatically close the status
    window unless you check the "Keep Open" checkbox.  Close
    QDVDAuthor when this step completes successfully.
    Approximate time: 10 minutes to create menu
    Approximate time: 15 minutes to create dvd
    (Actual time is dependent upon CPU speed and disk throughput.)
 6) Use K3b to burn the DVD.  Select File->NewProject->NewVideoDVDProject.
    First, doubleclick on the DVD writer.  If you have a blank DVD in
    the drive, it should say that and give you specs on the blank DVD.
    Look at the sample k3b-blank.png to see the description that
    appears when a blank DVD is in the drive.  Navigate the filesystem
    tree (left pane) to the directory that holds the DVD file 
    structure created by QDVDAuthor.  Drag the VIDEO_TS directory from
    the top right pane to the "K3b data project" tree on the bottom 
    pane.  You can drag the AUDIO_TS directory if you like, but it's 
    empty and does nothing for you.  You should see a bar at the 
    bottom of the window that shows how much of the available space 
    (4.4 GB) will be used.  Save the config file in a location of your
    choosing, I put it in the same directory as the AUDIO_TS and 
    VIDEO_TS directories.  When you're ready to burn, click the "Burn"
    icon and a dialog will pop up.  Just make sure the "Simulate"
    checkbox is not checked.  Click this dialog's Burn button and wait
    for it to finish.  Look at the sample k3b-writing.png to see what
    K3b tells you while it's burning.
    Approximate time: 14 minutes on my 4X DVD-RW burner


References:
http://qdvdauthor.sourceforge.net/
http://kino.schirmacher.de/
http://www.linuxgazette.com/issue83/stoddard.html
http://www.tappin.me.uk/Linux/dvd.html
