Readme: TStoATSC

http://www-personal.umich.edu/~balazer/atsc/

3-5-2006:  fixed cosmetic bug
9-3-2005:  added quiet option
6-10-2005:  added bit rate option, file split option, and bad video PID detection
5-17-2004:  original release

Summary


TStoATSC is an MPEG-2 transport stream to ATSC transport stream remultiplexer.  It takes one program from the input stream and generates an output stream at the ATSC bit-rate of 19.3 Mbps.  It works by looking at the PCRs.  It attempts to handle discontinuities and bad PCRs in a reasonable manner.

It should let you take almost any transport stream source (satellite, DVHS) and remux it into something that the hardware-based ATSC decoders which require a constant bit-rate input can handle. (HiPix, AccessDTV, HiDTV Pro)  Remuxing will in some cases fix streams that could not otherwise be dumped to D-VHS properly.

Restrictions

The input must have MPEG-2 video and AC3 audio.

Usage

Usage: tstoatsc [-c] [-s <MB>] [-b <Mbps>] [-q] <input file name> <output base name> <VIDEO_PID> <AUDIO_PID>
  specify PIDs in hex witout a leading 0x
   -c        :  correct PCRs
   -s <MB>   :  split output into files of <MB> megabytes
   -b <Mbps> :  output bit rate of <Mbps> Mbps
   -q        :  quiet mode - print less information to the console

If no split size is specified (-s option) the output defaults to one large file.

If no output bit rate is specified (-b option), the output bit rate defaults to the exact ATSC bit rate of 19.39... Mbps.  Don't try to enter the ATSC bit rate on the command line; the command line option doesn't support the precision necessary to achieve the exact ATSC bit rate.

Examples:

     TStoATSC g:\citytv.ts d:\Enterprise 1022 1023
     TStoATSC -s 222 -b 14.2 "Rush Hour.tp" "Rush Hour" 11 14

How to pick PIDs

TSReader Litehttp://www.coolstf.com/tsreader/

bbDMUX
:  part of bbTOOLS (try Google)

Notes and Limitations

TStoATSC renumbers the PIDs to 0x11 and 0x14, and generates new PATs and PMTs. 

TStoATSC treats each input file independently.  If you want to process input that is segmented into multiple files, you should combine the input into one large file first.

If PCR correction is not turned on, the remuxing process could introduce PCR jitter.  If the source is properly muxed, this jitter should be limited to less than one packet's worth - about 2000 clock ticks.  If PCR correction is turned off, the output is quite similar to the input - e.g., if the input is a single program variable bit-rate stream with no null packets, then you could nearly recover the original input by stripping the null packets from the output.  Leaving the PCRs uncorrected will give you output that can more likely be remuxed correctly again later.

Some players may have trouble playing streams if the PCRs are incorrect.  If playback is not perfect, try turning on PCR corrections.

It is possible that the input program's peak bit rate may exceed 19.3 Mbps.  The "overflow" is the number of packets by which a PCR packet must be pushed forward relative to its proper position (as dictated by the PCR value) to accommodate the number of packets in the PCR interval.  Overflow is handled intelligently, though if the magnitude of the overflow is too great, you might not achieve proper playback with some hardware decoders.  A well-behaved source will have 0 overflow.  The greater the overflow, the greater the PCR errors (if not corrected).

If playback has audio pops or dropouts, try TStoATSC3.

Warning

This code is not guaranteed bug-free.

Contact

e-mail

License

TStoATSC is licensed free for personal use.  You may not distribute the source or executable.