dtvstream - Digital TV stream processing tool

Version 1.0a2 4-03-2004

dtvstream is designed to be a useful tool for making and working
with recordings of digital TV.  Using dtvstream you can do the
following:
   get information about the programs and packet types being
     broadcast on a given channel
   record all the packets from a channel to a file
   record just a selected program from a channel to a file
   record for a specified number of minutes and seconds
   remove extraneous packets and programs from stream files
     (useful for D-VHS devices and to save space)
     
Here is the "help" command format description:

Format: dtvstream [options]
Options:
    -i input-file   Defaults to /dev/dtv
    -o output-file  Defaults to input-name.m2t
    -c channel      tune to indicated TV channel (2 - 83)
    -p prog         select the given DTV program number
                    "default" for the default program
                    "all" to process all packets
    -m mins         stop after this many minutes (added to secs)
    -s secs         stop after this many seconds (added to mins)
    -a count        number of initial packets to analyze (default 20000)
    -r    don't relace existing output file (default)
    -R    replace existing output file
    -q    just display stream program information
    -v    enable verbose output
    -d    enable debugging output (implies -v)
    -h    print this help text (also --help)

Here are some sample commands:

Record one program from /dev/dtv channel 41 to the file "41.m2t":
   dtvstream -c 41 -o 41.m2t
If the channel is broadcasting more than one program, after a few
seconds you will be prompted to choose from a list of available
programs.

Record all packets from /dev/dtv channel 41 to the file "41.dtv",
and stop after one hour:
   dtvstream -c 41 -o 41.dtv -p all -m 60

Record program 2 from /dev/dtv2 channel 41 to the file "41-2.m2t":
   dtvstream -c 41 -i /dev/dtv2 -o 41-2.m2t -p 2
This is useful if you already know the program numbers a channel
is using.

Display program information for (RF) channel 19:
  dtvstream -c 19 -q
Include -v to get additional information.

Remove extraneous packets from a file, leaving just those necessary
for a simple MPEG transport stream with one program:
  dtvstream -i source.dtv -o dest.m2t
As for recording, if the source file contains more than one program
then you will be prompted to select the one to use.

Credits:

A small amount of code based on the HD-2000 software is used to change channels.

The code makes extensive use of the NIST/ATSC parser reference implementation.

Complete source code is available on request, and will be freely available for
download when the program has been more fully tested.

Peter DiCamillo
Peter_DiCamillo@brown.edu
