These were the changes made by PCDVDGUY in adding support for
ATSC (HDTV) transport streams.
--------------------------------------

changes.doc (03/29/2002, late at night...)
-----------------
if upgrading from an older version of dvd2avi.exe, be sure to *delete* your old
dvd2avi.ini!

MPEG-2 transport streams can carry several different independent MPEG-2 programs.  To
select a program, you will need to know the 'VideoID' and 'AudioID' of the desired
program.  Currently, DVD2AVI cannot do this for you : you must hand-edit the dvd2avi.ini
file.

1) Look for the line "MPEG2_Transport_PID=VV,AA"
2) Replace 'VV' with the hexadecimal ID of the the MPEG-2 video stream.  Replace 'AA'
with the hexadecimal ID of the AC3 audio stream.

-----------------
This document explains the changes made to the DVD2AVI/MPEG2DEC.DLL source-code, for the
purpose of decoding MPEG-2 transport streams.

Special thanks to Ben Cooley, for writing HDTVtoMPEG2, a great source of inspiration!

MPEG-2 transport stream demuxing

	This feature allows MPEG2DEC.DLL to parse MPEG2 transport streams (*.trp, *.ts), and
	decode both MPEG-1/2 video elementary streams and AC3-audio streams.  It has been
	successfully tested with several ATSC/DTV broadcasters in the Southern California
	area.  The code to support this feature is still considered 'preliminary', and
	suffers from the following limitations:

0) The transport-stream demuxer cannot extract MPEG-audio streams.  This should be added
in the future..

1) When opened in DVD2AVI, the input-filename extension *.trp and *.ts are
unconditionally treated as transport-streams.  Otherwise, other input-filenames are
briefly checked (first 2048 bytes) for an MPEG-2 transport sync-byte sequence.  If this
sequence is found, the entire stream is treated as an MPEG-2 transport stream.

2) There is currently *NO* GUI to select the video-ID and audio-ID.  These variables are
stored in the DVD2AVI.ini file, and the user (that's YOU) must manually edit the ini
file to set the video-ID and audio-ID.

2) If you want to use avisynth with DVD2AVI, you will need the updated MPEG2DEC.DLL.
The updated DLL has added support for transport-stream demuxing.  If you want to use
DVD2AVI as a VFAPI frameserver, you will need the updated DVD2AVI.VFP (for the same
reason.)

3) Do NOT mix MPEG-2 program streams (*.vob, *.mpg) and MPEG-2 transport streams (*.trp,
*.ts) in the same d2v project-file!  

4) DVD2AVI is sensitive to bitstream errors.  Your broadcast DTV recordings may contain
errors, which will manifest as distortion, image breakup, and other visual artifacts.
At worst, mpeg2dec.dll can crash.  Unfortunately, there is no way to guard against this
except to routinely check your DTV-receiver's quality-monitor and adjust accordingly.

mpeg2dec.dll relies on the variable "SystemStream_Flag==2" to identify
transport-streams.  (In the d2v-project file, the following line indicates the
video_stream_id and audio_stream_id, but only the video_stream_id is used.)

5) The ATSC DTV standard allows many different formats. To work with the
highest-resolution mode (1920x1080 30i), a fast CPU and lots of memory is recommended!

Source code-changes
----------------------------
SystemStream_Flag == 2 ; // MPEG-2 transport stream (calls to Next_Packet() are
redirected to Next_Transport_Packet() )

global.h - add declaration for function "Next_Transport_Packet()"
  int MPEG2_Transport_VideoPID;  // VideoID for MPEG-2 transport streams
  int MPEG2_Transport_AudioPID;// AudioID for MPEG-2 transport streams

getbit.c - add function Next_Transport_Packet(), this does the bulk of the work!

gui.cpp - initializes the variables (MPEG2_Transport_VideoPID,
MPEG2_Transport_AudioPID), first by reading from dvd2avi.ini, and then by re-reading
those values from the D2V project file (if one is opened, and the SystemStream_Flag==2.)
Also modify the 'open' dialog-box, to add an entry for file-filter ("*.trp, *.ts")

mpeg2dec.c - scans the first 2048 bytes of the MPEG-bitstream (to check if it's an
MPEG-2 transport-stream.)

liaor@iname.com
http://members.tripod.com/~liaor