Here's how I convert programs on the TiVo to DVDs for archival.

Things needed

Procedure

  1. Use TivoWeb to get the list of FSIDs for the program; for example: 18022,18024,18025

  2. Run Playitsam, giving it the TiVo's hostname, the FSIDs, and the output file names:

    playitsam tivo:18022,18024,18025 program.mpa program.mpv
  3. Perform editing operations in Playitsam (see the documentation for details). Then, either:
    • If you are going to do the heavy lifting on the same machine, press R to record the stream to the output files.
    • If you want to do the processing on another machine (maybe with more disk space or CPU power), follow these steps:
      1. In Playitsam, press L to get the cut list, for example:
        Here is the list of cuts:
          cut from chunk 0 to 496
          cut from chunk 28273 to infinity
      2. On the other machine, use the nvcut tool (also part of Playitsam) to download the actual stream. The cut list becomes the final arguments. Eg:

        nvcut tivo:18022,18024,18025 program.mpa program.mpv 0 496 28273
  4. Transcode the audio stream to AC3 with ffmpeg:

    ffmpeg -i program.mpa -ar 48000 -ab 192 -acodec ac3 program.ac3
  5. Multiplex the audio and video streams, using the mplex program from the mjpegtools package.

    mplex -f 8 -o program.mpg program.mpv program.ac3

    NB: on one recording, I found that the audio was out of sync about half a second ahead of the video. I don't know what caused it, but if you have the same problem, you can use the -O option to mplex to correct it. You will need to determine the correct offset experimentally, in my case I used -O -500ms.

  6. Create a DVD filesystem and menus with the dvdwizard program. At this point you can also put other programs on the DVD or make nicer menus. See the dvdwizard documentation for details. An example command-line is:

    dvdwizard -T 'disc title' -N PAL -A en -t 'program title' -c 900 program.mpg
  7. If the program is in anamorphic widescreen (for example, if it was recorded from a set-top box in 16:9 mode), the generated DVD will have the wrong aspect ratio of 4:3. If this is the case, you need to edit the generated dvdwizard.xml file, changing aspect="4:3" to aspect="16:9" where appropriate, then reauthor the DVD:

    rm -r dvd && dvdauthor -x dvdwizard.xml
  8. Test the result in your favourite software DVD player, eg. Xine or mplayer:
    xine dvd:$PWD/dvd
    mplayer -dvd-device $PWD/dvd dvd://
  9. If you're happy, burn it to a DVD:
    growisofs -dvd-compat -Z /dev/dvdrw -dvd-video dvd/