Annotation of multiplexer/iso13818ts.1, revision 1.10

1.1       oskar       1: .\" Man page for iso13818ts
                      2: .\"
                      3: .\" Copyright (C) 2001, Convergence Integrated Media GmbH
                      4: .\" Author: Oskar Schirmer
                      5: .\"
                      6: .TH iso13818ts 1 "April 30th, 2001" "0.0.2" "Multiplexer"
                      7: .SH NAME
                      8: iso13818ts \- multiplexer for ISO 13818 transport streams
                      9: .SH SYNOPSIS
                     10: iso13818ts [COMMAND...]
                     11: .SH DESCRIPTION
                     12: Generates an ISO 13818-1 conforming transport stream from multiple
                     13: input streams.
                     14: The result is sent to \fIstdout\fR,
                     15: the input streams are read from explicitely opened files.
                     16: All of the following commands may also be fed to \fIstdin\fR during
                     17: operation by omitting the leading hyphen (e.g. \fBQ\fR) or
                     18: double-hyphen (e.g. \fBquit\fR).
                     19: .TP
                     20: \fB\-\-help\fR
                     21: Display this help.
                     22: .TP
                     23: \fB\-V\fR, \fB\-\-version\fR
                     24: Output version information.
                     25: .TP
                     26: \fB\-Q\fR, \fB\-\-quit\fR
                     27: Quit this program.
                     28: .TP
                     29: \fB\-v\fR, \fB\-\-verbose\fR [\fIlevel\fR]
                     30: Verbose mode, \fIlevel\fR = 0..6, default is 2 (providing warnings
                     31: concerning data errors), initial verbosity is 1 (providing only
                     32: program errors).
                     33: .TP
                     34: \fB\-p\fR, \fB\-\-pes\fR \fIfile\fR \fItarget_program\fR
                     35: Open a PES input \fIfile\fR,
                     36: output the contained stream as \fItarget_program\fR (range 0x0001..0xFFFF).
                     37: .TP
                     38: \fB\-p\fR, \fB\-\-pes\fR \fIfile\fR \fItarget_program\fR \fItarget_stream_id\fR
                     39: Open a PES input \fIfile\fR,
                     40: output the contained stream in \fItarget_program\fR (range 0x0001..0xFFFF)
                     41: with \fItarget_stream_id\fR (recommended range 0xBD..0xFE).
                     42: The \fIfile\fR may be specified as \fB=\fR to denote
                     43: the last previously mentioned file.
                     44: .TP
                     45: \fB\-P\fR, \fB\-\-ps\fR \fIfile\fR \fItarget_program\fR
                     46: Open a PS input \fIfile\fR,
                     47: output the contained program as \fItarget_program\fR (range 0x0001..0xFFFF).
                     48: .TP
                     49: \fB\-P\fR, \fB\-\-ps\fR \fIfile\fR \fItarget_program\fR \fIsource_stream_id\fR [\fItarget_stream_id\fR]
                     50: Open a PS input \fIfile\fR,
                     51: extract the stream with \fIsource_stream_id\fR (range 0x00..0xFF)
                     52: and output that stream in \fItarget_program\fR (range 0x0001..0xFFFF)
                     53: with \fItarget_stream_id\fR (recommended range 0xBD..0xFE).
                     54: If no \fItarget_stream_id\fR is given, \fIsource_stream_id\fR is used instead.
                     55: The \fIfile\fR may be specified as \fB=\fR to denote
                     56: the last previously mentioned file.
                     57: .TP
                     58: \fB\-T\fR, \fB\-\-ts\fR \fIfile\fR
                     59: Open a TS input \fIfile\fR,
                     60: extract all programs from it and output them.
                     61: Note, that additional SI data is not propagated,
                     62: see command \fB\-\-si\fR for further information.
                     63: .TP
                     64: \fB\-T\fR, \fB\-\-ts\fR \fIfile\fR \fIsource_program\fR [\fItarget_program\fR]
                     65: Open a TS input \fIfile\fR,
                     66: extract the program \fIsource_program\fR (range 0x0001..0xFFFF)
                     67: and output that program as \fItarget_program\fR (range 0x0001..0xFFFF).
                     68: If no \fItarget_program\fR is given,
                     69: don't change the \fIsource_program\fR number.
                     70: The \fIfile\fR may be specified as \fB=\fR to denote
                     71: the last previously mentioned file.
                     72: .TP
                     73: \fB\-T\fR, \fB\-\-ts\fR \fIfile\fR \fIsource_program\fR \fItarget_program\fR \fIsource_stream_id\fR [\fItarget_stream_id\fR]
                     74: Open a TS input \fIfile\fR,
                     75: extract the stream with \fIsource_stream_id\fR (range 0x00..0xFF)
                     76: from the program \fIsource_program\fR (range 0x0001..0xFFFF)
                     77: and output that stream as \fItarget_stream_id\fR (recommended range 0xBD..0xFE)
                     78: in program \fItarget_program\fR (range 0x0001..0xFFFF).
                     79: If no \fItarget_stream_id\fR is given, use \fIsource_stream_id\fR instead.
                     80: The \fIfile\fR may be specified as \fB=\fR to denote
                     81: the last previously mentioned file.
                     82: .TP
                     83: \fB\-c\fR, \fB\-\-close\fR \fIfile\fR
                     84: Close input \fIfile\fR, as if eof is reached.
                     85: In combination with \fB\-\-repeat\fR this causes the next repeatition
                     86: to start immediately.
                     87: Note, that the input data file is cut of as is, i.e. no attempt
                     88: is made to close the file on a clean audio or video frame border.
                     89: .TP
                     90: \fB\-a\fR, \fB\-\-append\fR \fIfile1\fR \fIfile2\fR [\fInum\fR]
                     91: Earmark another \fIfile2\fR to be opened as soon as \fIfile1\fR
                     92: comes to its end.
                     93: The appended \fIfile2\fR is foreseen to be repeated \fInum\fR
                     94: times, default is 1 (see \fB\-\-repeat\fR).
                     95: Both files must contain the same type of data,
                     96: as the data of both files is chained without considering clean
                     97: transition of audio or video sequences.
                     98: The \fIfile1\fR may be specified as \fB=\fR to denote
                     99: the last previously mentioned file.
                    100: .TP
                    101: \fB\-f\fR, \fB\-\-file\fR \fIreference_number\fR \fIfile_name\fR
                    102: The positive \fIreference_number\fR is associated with a \fIfile_name\fR.
                    103: For all following commands, the \fIreference_number\fR may be
                    104: used instead of the \fIfile_name\fR. This allows better control
                    105: over file handles, as the same file may be addressed via different
                    106: \fIreference_number\fRs.
                    107: .TP
                    108: \fB\-x\fR, \fB\-\-crop\fR \fItarget_program\fR [\fItarget_stream_id\fR]
                    109: Delete a stream given by \fItarget_stream_id\fR,
                    110: or a complete program given by \fItarget_program\fR
                    111: from the output.
                    112: The corresponding input file will be closed, if not needed otherwise.
                    113: .TP
                    114: \fB\-r\fR, \fB\-\-repeat\fR \fIfile\fR \fInum\fR
                    115: Set the repeatition counter for \fIfile\fR to \fInum\fR
                    116: (or to infinite if \fInum\fR=0).
                    117: The file will be reset as soon as eof is reached
                    118: (or it is closed by the command \fB\-\-close\fR).
                    119: Note, that the file will be reset without considering clean transition
                    120: of audio or video sequences at the restart point.
                    121: The \fIfile\fR may be specified as \fB=\fR to denote
                    122: the last previously mentioned file.
                    123: .TP
                    124: \fB\-R\fR, \fB\-\-reopen\fR
                    125: This command shall precede one of the commands that open a new file
                    126: (i.e. \fB\-\-pes\fR, \fB\-\-ps\fR or \fB\-\-ts\fR must follow
                    127: \fIon the same line\fR).
                    128: The next file will be opened with a new file handle,
                    129: regardless of whether the same file is yet open or not.
                    130: .TP
                    131: \fB\-\-si\fR \fIfile\fR [\fIlower_bound\fR \fIupper_bound\fR]
                    132: In a TS \fIfile\fR, all TS pakets with PID in the range
                    133: from \fIlower_bound\fR to \fIupper_bound\fR
1.9       oskar     134: (possible range 0x0001..0x1FFE, recommended range 0x10..0x1F)
1.1       oskar     135: inclusive are handled as SI pakets (according to ETSI EN 300 468).
                    136: These pakets are bypassed and promoted to the output without further handling.
                    137: If no further data from the \fIfile\fR is in use,
                    138: the SI pakets are promoted \fIgreedy\fR, i.e. without any timing or delay. 
                    139: If \fIlower_bound\fR and \fIupper_bound\fR are omitted,
                    140: the special handling of SI pakets is turned off for the given \fIfile\fR.
1.5       oskar     141: \fBNOTE, that the \fIfile\fB must be opened with \-\-ts before!\fR
1.1       oskar     142: The \fIfile\fR may be specified as \fB=\fR to denote
                    143: the last previously mentioned file.
                    144: .TP
1.9       oskar     145: \fB\-\-sipid\fR \fItarget_program\fR [\fIpid\fR [\fIstream_type\fR]]
                    146: Manually add or delete entries to the target PMT for the given
                    147: \fItarget_program\fR.
                    148: To add an entry, all three parameters must be provided.
                    149: If an entry for the given \fIpid\fR (range 0x0001..0x1FFE) does exist,
                    150: the new \fIstream_type\fR (range 0x00..0xFF) is set
                    151: and all descriptors are cleared.
                    152: If no \fIstream_type\fR is given, a corresponding entry
                    153: in the PMT is deleted,
                    154: if it was added thru \fB\-\-sipid\fR earlier.
                    155: If no \fIpid\fR and no \fIstream_type\fR is given, all
                    156: entries for the \fItarget_program\fR in the PMT are deleted,
                    157: which have been added thru \fB\-\-sipid\fR earlier.
                    158: Note, that regular entries, i.e. those which are generated
                    159: automatically instead of using \fB\-\-sipid\fR,
                    160: cannot be changed.
                    161: Note, that entries added through \fB\-\-sipid\fR are
                    162: solely entries in the PMT, but there is not any corresponding
                    163: data stream created.
                    164: \fB\-\-sipid\fR is meant to be used in conjunction
                    165: with the \fB\-\-si\fR command, which in turn causes
                    166: data to arise in the target stream without listing it
                    167: in the PMT.
                    168: .TP
1.10    ! oskar     169: \fB\-\-descr\fR \fItarget_program\fR [\fIdescr_tag\fR [\fIdescr_length\fR \fIdata\fR...]]
        !           170: Add, inhibit or delete in the PMT section a descriptor,
        !           171: that does \fBnot\fR belong to a specific stream.
        !           172: To add a descriptor, all parameters must be given,
        !           173: \fIdescr_tag\fR (range 0x00..0xFF),
        !           174: \fIdescr_length\fR (range 1..255),
        !           175: and the appropriate amount of bytes given as \fIdata\fR (range 0x00..0xFF).
        !           176: To inhibit any descriptor with a given \fIdescr_tag\fR,
        !           177: \fIdescr_length\fR is set to \fB0\fR and no \fIdata\fR is given.
        !           178: This causes matching descriptors from input streams to
        !           179: be discarded instead of being copied to the target stream.
        !           180: To delete the manual setting of a descriptor,
        !           181: \fIdescr_length\fR is omitted. This causes descriptors
        !           182: with matching \fIdescr_tag\fR to be passed from input to
        !           183: the target stream.
        !           184: To delete all manual settings for a \fItarget_program\fR,
        !           185: that do \fBnot\fR belong to a specific stream,
        !           186: the \fIdescr_tag\fR is omitted, too.
        !           187: Note, that \fB\-\-descr\fR never modifies descriptors,
        !           188: that belong to a specific stream.
        !           189: To modify these, use the command \fB\-\-sdescr\fR or \fB\-\-pdescr\fR.
        !           190: .TP
        !           191: \fB\-\-sdescr\fR [\fItarget_program\fR [\fIstream_id\fR [\fIdescr_tag\fR [\fIdescr_length\fR \fIdata\fR...]]]]
        !           192: Add, inhibit or delete in the PMT section a descriptor,
        !           193: that does belong to a specific stream.
        !           194: To add a descriptor, all parameters must be given,
        !           195: \fIstream_id\fR (recommended range 0xBD..0xFE),
        !           196: \fIdescr_tag\fR (range 0x00..0xFF),
        !           197: \fIdescr_length\fR (range 1..255),
        !           198: and the appropriate amount of bytes given as \fIdata\fR (range 0x00..0xFF).
        !           199: To inhibit any descriptor with a given \fIdescr_tag\fR,
        !           200: \fIdescr_length\fR is set to \fB0\fR and no \fIdata\fR is given.
        !           201: This causes matching descriptors from the corresponding input streams to
        !           202: be discarded instead of being copied to the target stream.
        !           203: To delete the manual setting of a descriptor,
        !           204: \fIdescr_length\fR is omitted. This causes descriptors
        !           205: with matching \fIdescr_tag\fR to be passed from input to
        !           206: the target stream.
        !           207: To delete all manual settings for a \fIstream_id\fR in
        !           208: the \fItarget_program\fR,
        !           209: the \fIdescr_tag\fR is omitted, too.
        !           210: To delete all manual settings for all streams \fBand\fR those
        !           211: that do not belong to a specific stream,
        !           212: the \fIstream_id\fR is omitted, too.
        !           213: Finally, to delete all manual settings in all programs,
        !           214: all parameters are omitted.
        !           215: .TP
        !           216: \fB\-\-pdescr\fR [\fItarget_program\fR [\fIpid\fR [\fIdescr_tag\fR [\fIdescr_length\fR \fIdata\fR...]]]]
        !           217: Add, inhibit or delete in the PMT section a descriptor,
        !           218: that does belong to a specific stream.
        !           219: To add a descriptor, all parameters must be given,
        !           220: \fIpid\fR (range 0x0001..0x1FFE),
        !           221: \fIdescr_tag\fR (range 0x00..0xFF),
        !           222: \fIdescr_length\fR (range 1..255),
        !           223: and the appropriate amount of bytes given as \fIdata\fR (range 0x00..0xFF).
        !           224: To inhibit any descriptor with a given \fIdescr_tag\fR,
        !           225: \fIdescr_length\fR is set to \fB0\fR and no \fIdata\fR is given.
        !           226: This causes matching descriptors from the corresponding input streams to
        !           227: be discarded instead of being copied to the target stream.
        !           228: To delete the manual setting of a descriptor,
        !           229: \fIdescr_length\fR is omitted. This causes descriptors
        !           230: with matching \fIdescr_tag\fR to be passed from input to
        !           231: the target stream.
        !           232: To delete all manual settings for a \fIpid\fR in
        !           233: the \fItarget_program\fR,
        !           234: the \fIdescr_tag\fR is omitted, too.
        !           235: To delete all manual settings for all streams \fBand\fR those
        !           236: that do not belong to a specific stream,
        !           237: the \fIpid\fR is omitted, too.
        !           238: Finally, to delete all manual settings in all programs,
        !           239: all parameters are omitted.
        !           240: Note, that, in contrast to \fB\-\-descr\fR and \fB\-\-sdescr\fR,
        !           241: with \fB\-\-pdescr\fR it is possible to set
        !           242: descriptors for PMT entries, that have been added using \fB\-\-sipid\fR.
        !           243: .TP
1.1       oskar     244: \fB\-I\fR, \fB\-\-ident\fR \fItransport_stream_id\fR
                    245: Set the output \fItransport_stream_id\fR (range 0x0000..0xFFFF).
                    246: .TP
                    247: \fB\-B\fR, \fB\-\-busy\fR [\fInum\fR]
                    248: Set the busy flag to \fInum\fR (range 0..1, default is 1).
                    249: Whenever the program has no more data to handle and
                    250: the busy flag is not set, it stops.
                    251: .TP
                    252: \fB\-\-timed\fR
                    253: Force delay timing, even if solely disk files are in use.
                    254: If not so, if delay is to be awaited while processing regular files,
                    255: the delay is skipped instead and timing information in the resulting
                    256: file is adjusted accordingly.
                    257: .TP
                    258: \fB\-F\fR, \fB\-\-fpsi\fR \fItime\fR
                    259: Set the PSI table frequency to \fItime\fR msec
                    260: (or to infinite if \fItime\fR=0, initial value is infinite).
                    261: The PAT and PMT will be generated at more or less the given
                    262: frequency, even if the tables did not change.
                    263: In any case, the next tables will be generated immediately.
                    264: .TP
1.7       oskar     265: \fB\-\-trigin\fR \fItime\fR
                    266: Set the input buffer trigger timing to \fItime\fR.
                    267: For any input stream, that is newly opened
                    268: (or has to be retriggered, e.g. due to intermediate emptiness),
                    269: the buffer is triggered for promotion to the splice unit
                    270: with a delay of \fItime\fR msec compared to the time
                    271: of data entrance into the buffer.
                    272: For any stream yet triggered the timing is not changed
                    273: unless retriggering takes place.
                    274: Not affected by this value are the other trigger conditions,
                    275: mainly a certain buffer fullness
                    276: and cotriggering with a corresponding stream that is triggered.
                    277: .TP
                    278: \fB\-\-trigout\fR \fItime\fR
                    279: Set the output buffer trigger timing to \fItime\fR.
                    280: As the output buffer is triggered for promotion to \fIstdout\fR,
                    281: this is done with a delay of \fItime\fR msec compared to the time
                    282: of data entrance into the buffer.
                    283: The new timing is only valid if set before the first triggering
                    284: of the output buffer,
                    285: or if retriggering takes place, e.g. due to intermediate emptiness.
                    286: Not affected by this value is the trigger condition
                    287: of a certain buffer fullness.
                    288: .TP
1.4       oskar     289: \fB\-C\fR, \fB\-\-config\fR \fInum\fR
                    290: Order output configuration of target stream with \fInum\fR=1,
                    291: switch off with \fInum\fR=0.
1.10    ! oskar     292: Set \fInum\fR=2, to get information about descriptors, too.
1.4       oskar     293: When switched on, the configuration is printed each time it changes.
                    294: First, the number of programs is printed,
                    295: then for each program one line of description and
                    296: for each stream within that program another line is printed.
1.10    ! oskar     297: When \fInum\fR=2, then for each descriptor there is printed one more line.
1.4       oskar     298: The following values are compiled:
                    299: .RS
                    300: .TP
                    301: \fIprogs\fR
                    302: Number of programs in target stream.
                    303: .TP
                    304: \fIprog\fR
                    305: Program number within target stream.
                    306: .TP
                    307: \fIpmt\fR
                    308: PMT PID for the program.
                    309: .TP
                    310: \fIpcr\fR
                    311: PCR PID for the program.
                    312: .TP
                    313: \fIstreams\fR
                    314: Number of streams in the program.
1.9       oskar     315: A number in parantheses may be added that denotes how many of these
                    316: streams are not PES data streams, but have been added by use of the
                    317: \fB\-\-sipid\fR option to the PMT.
1.4       oskar     318: .TP
                    319: \fIstream\fR
                    320: Stream PID.
                    321: .TP
1.9       oskar     322: \fItype\fR
                    323: Stream type (according to ISO 13818-1 table 2-29).
                    324: .TP
1.4       oskar     325: \fIsid\fR
                    326: PES stream ID.
                    327: .TP
                    328: \fIfile\fR
                    329: Source file contents type (PES=0, PS=1, TS=2).
                    330: .TP
                    331: \fIsource\fR
                    332: Stream index in source file (SID for PS, PID for TS).
                    333: .TP
                    334: \fInum\fR
                    335: Source file reference number (-1 if none).
                    336: .TP
                    337: \fIname\fR
                    338: Source file name.
1.10    ! oskar     339: .TP
        !           340: \fIdescr\fR
        !           341: Descriptor tag.
        !           342: .TP
        !           343: \fIlen\fR
        !           344: Descriptor length, number of data bytes in the descriptor.
        !           345: .TP
        !           346: \fIdata\fR
        !           347: Descriptor data, bytewise.
1.4       oskar     348: .RE
                    349: .TP
1.2       oskar     350: \fB\-S\fR, \fB\-\-statistics\fR \fItime\fR
                    351: Order output load statistics to be generated about every
                    352: \fItime\fR msec.
1.4       oskar     353: Switch off with \fItime\fR=0.
                    354: The statistics are written to \fIstderr\fR linewise,
                    355: the following values are calculated:
1.2       oskar     356: .RS
                    357: .TP
                    358: \fInow\fR
                    359: Internal clock in msec.
                    360: .TP
                    361: \fIout\fR
1.7       oskar     362: Number of bytes written to stdout since last statistics,
                    363: and number of write operations needed.
1.2       oskar     364: .TP
                    365: \fIbuf\fR
1.7       oskar     366: Number of bytes in the output buffers (lower and upper bound).
1.2       oskar     367: .TP
                    368: \fItime\fR
1.7       oskar     369: Time in msec, for how long the contents of the
                    370: output buffers should suffice (lower and upper bound).
                    371: .TP
                    372: \fIburst\fR
                    373: Size of write burst, i.e. number of bytes prepared to
                    374: be written in a single write operation (lower and upper bound).
1.2       oskar     375: .RE
                    376: .TP
1.1       oskar     377: \fB\-\-badtiming\fR
                    378: In conjunction with a program stream originating from a DVB-s
                    379: digital TV receiver card, You might want to automatically
                    380: correct some of the PCR values produced by that card, to
                    381: prevent discontinuities in the output.
                    382: .SH OVERVIEW
                    383: The multiplexer is designed to run uninterrupted and
                    384: be controlled via \fIstdin\fR and \fIstderr\fR.
1.8       oskar     385: It is designed to process data in real time,
                    386: i.e. if the processing is not performed fast
                    387: enough (e.g. because of low processor performance),
                    388: errors in the resulting data may occur, namely
                    389: concerning the timing.
1.9       oskar     390: The multiplexer may be invoked interactively with
1.8       oskar     391: the streams to process given as command line options
                    392: or with the commands to be processed typed into
                    393: \fIstdin\fR during operation.
1.1       oskar     394: The latter type of usage is also designed for use
                    395: with an user interface front-end, that may
                    396: translate some GUI input to iso13818ts commands
                    397: and filter its responses to be presented to the user
                    398: as appropriate.
                    399: .P
                    400: Three different types of input are supported:
                    401: Paketized elementary streams (PES),
                    402: Program streams (PS),
                    403: Transport streams (TS).
                    404: .P
                    405: Numeric parameters may be given in decimal (e.g. 31)
                    406: or in hex (e.g. 0x1F).
                    407: .SH DETAILS
                    408: The output file or device does not change throughout the
                    409: time the program runs. The input files, however, may vary.
                    410: Also the contents of an input file may vary, but not its
                    411: type. E.g., a file opened as program stream must contain
                    412: valid program stream data up to its end (and including
                    413: any files that are appended to this file with \fB\-\-append\fR).
                    414: .P
                    415: All basic PSI is evaluated contiguously, and changes in
                    416: the configuration (changing PID, etc.) are taken into
1.3       frankro   417: account and tracked. Thus a stream should not get lost
1.1       oskar     418: simply because its PID is changed in the middle of the
                    419: broadcast.
                    420: .P
                    421: When remultiplexing a transport stream, the user cannot
                    422: rely on the original PIDs to be the same in the output stream.
                    423: Usually output PIDs are different from input PIDs.
                    424: This is because all basic PSI is composed from scratch for the
                    425: output stream, with exception of the descriptors.
                    426: These are not evaluated but only copied and reused
                    427: as appropriate.
                    428: .P
                    429: For each output program one stream within this program
                    430: must contain PCR time stamps. The strategy in selecting
                    431: which stream shall carry the PCR is, first see if there
                    432: is one input stream that contains PCR, if none is found,
                    433: use the stream for which data packets are found first.
                    434: Note, that for a simple mono TV program this is not
                    435: necessarily the video stream.
1.9       oskar     436: .P
                    437: When using the command \fB\-\-si\fR,
                    438: PID collisions may occur with source stream PIDs
                    439: as well as with target stream PIDs.
                    440: .br
                    441: For source collisions, data streams win,
                    442: i.e. if a packet is encountered,
                    443: that matches the PAT and PMT description of the input file
                    444: as well as the range given by \fB\-\-si\fR,
                    445: the latter match is ignored and the packet is
                    446: processed as PES data packet
                    447: (or PMT packet, if appropriate).
                    448: .br
                    449: For target collisions, the \fB\-\-si\fR range wins,
                    450: i.e. the attempt is made not to assign PIDs to
                    451: target data streams (or PMT streams),
                    452: that are covered by a range given by \fB\-\-si\fR.
                    453: If this attempt fails, e.g. because the full range
                    454: was given with \fI\-\-si 0x0010 0x1FFE\fR,
                    455: the potential collision is accepted, because there
                    456: is no easy algorithm to get around it.
                    457: Instead, the user should avoid covering the full range
                    458: with \fB\-\-si\fR and preferredly only state those
                    459: PIDs, which actually will contain SI packets.
                    460: .P
                    461: Note, that no collision check is done for PIDs,
                    462: that are given with the \fB\-\-sipid\fR command.
                    463: This is because these PIDs are assumed to be
                    464: covered by a corresponding \fB\-\-si\fR.
1.1       oskar     465: .SH EXAMPLES
                    466: To convert a program stream file x.PS to a transport stream file x.TS,
                    467: with program number 42, transport stream id 23
                    468: and PAT and PMT generated about every half second:
                    469: .IP
                    470: $ iso13818ts --fpsi 500 --ident 23 --ps x.PS 42 > x.TS
                    471: .PP
                    472: If the program stream doesn't contain correct PSI,
                    473: the single streams may be extracted one by one. Assuming
                    474: one video stream (0xE0) and mono audio (0xC0):
                    475: .IP
1.7       oskar     476: $ iso13818ts --fpsi 500 --ident 23 --ps x.PS 42 0xE0 --ps = 42 0xC0 > x.TS
1.1       oskar     477: .PP
                    478: To bundle two streams originating from video devices and
                    479: send them out to a streaming device, e.g.:
                    480: .IP
                    481: $ iso13818ts -F 500 -P /dev/video0 0x7300 -P /dev/video1 0x7301 > /dev/xdvb0
                    482: .PP
                    483: To remultiplex a transport stream containing two TV programs
                    484: with program numbers 4711 and 4712, with the audio streams (0xC0)
                    485: of the TV programs exchanged:
                    486: .IP
                    487: $ iso13818ts -F 500 --file 1 /dev/rdvb0 --ts 1 4711 4711 0xE0 --ts 1 4712 4712 0xE0 --ts 1 4711 4712 0xC0 --ts 1 4712 4711 0xC0 > /dev/xdvb0
                    488: .PP
                    489: To invoke the multiplexer for interactive use, it must
                    490: be put in all-time-busy-mode. Subsequently, commands can
                    491: be fed to \fIstdin\fR, e.g. to do the same as with the
                    492: first example:
                    493: .IP
                    494: $ iso13818ts --busy > x.TS
                    495: .br
                    496: fpsi 500 ident 23
                    497: .br
                    498: ps x.PS 42
                    499: .PP
                    500: This instance of the multiplexer will not cease when the
                    501: end of file in x.PS is reached. To stop the multiplexer,
                    502: either \fBquit\fR or \fBbusy 0\fR may be typed to \fIstdin\fR.
                    503: .P
                    504: To output a movie repeatedly (e.g. seven times):
                    505: .IP
                    506: $ iso13818ts -F 500 --ps thepurpleroseofcairo.PS 777 --repeat = 7 > /dev/xdvb0
                    507: .PP
                    508: Note, that if during the movie is processed, the command
                    509: .IP
                    510: close thepurpleroseofcairo.PS
                    511: .PP
                    512: is issued, and supposed it is not yet processed the seventh time,
                    513: it is not closed, but restarted immediately.
                    514: .P
                    515: To concatenate two movies and output them in sequence:
                    516: .IP
                    517: $ iso13818ts -F 500 --ps rambo1.PS 789 --append = rambo2.PS > /dev/xdvb0
                    518: .PP
                    519: Note, that a file can only be appended to a file, that is
                    520: yet in use (i.e. being processed). Thus, it is not possible
                    521: to append a third movie (rambo3.PS) from within the command
                    522: line. Instead, the processing of the second movie must be
                    523: awaited, and then the following command can be fed to \fIstdin\fR:
                    524: .IP
                    525: append rambo2.PS rambo3.PS
                    526: .PP
                    527: To add data from a DSMCC carousel to the output, a DSMCC
                    528: carousel generator must be started seperately. The carousel
                    529: must generate the DSMCC data as a series of transport
                    530: stream packets that contain private sections. The PIDs used by
1.7       oskar     531: the carousel must be known (e.g. 0x10..0x1F). Supposed use of
                    532: the DSMCC carousel data provider \fIrepeatts\fR:
1.1       oskar     533: .IP
                    534: $ mkfifo dsmcc_pipe
                    535: .br
1.7       oskar     536: $ repeatts 8000 2000 dsmcc_data.TS > dsmcc_pipe &
1.1       oskar     537: .br
                    538: $ iso13818ts -F 500 --busy --ts dsmcc_pipe --si = 0x10 0x1F > /dev/xdvb0
                    539: .br
                    540: ps x.PS 42
                    541: .br
                    542: ps y.PS 43
                    543: .br
                    544: \&...
                    545: .PP
                    546: .SH "KNOWN PROBLEMS"
                    547: The program might not work in conjunction with device drivers
                    548: that do not deliver or accept data unless a first read or write
                    549: is done on the device. E.g., for a MPEG video data source, that
                    550: does not produce output without being triggered by being read
                    551: from, this program will await the readability of the first
                    552: data infinitely. On the other hand it is obvious that the driver
                    553: should not encode data as long as there is no application that
                    554: will read this data.
                    555: One possibly solution to this dilemma is to patch such a driver
                    556: to interpret the \fIpoll\fR command as an order for data, thus
                    557: triggering the read mechanisms. Analogous considerations hold
                    558: for polling the output device and writing to it.
                    559: .P
                    560: Paketized elementary streams do not necessarily contain
                    561: usable time stamps, so when multiplexing raw PES, streams
                    562: belonging together may be out of sync. This is especially
                    563: noteworthy in case streams shall be demultiplexed and then
                    564: again multiplexed in some way. Results will always be better
                    565: when this remultiplexing takes place entirely within the
1.3       frankro   566: multiplexer, because that way timing information won't get lost.
1.1       oskar     567: .SH BUGS
1.9       oskar     568: End of action sometimes is not detected correctly, which
                    569: causes the multiplexer to hang.
                    570: Nevertheless, it then can be stopped by the \fBquit\fR command.
1.10    ! oskar     571: .P
        !           572: Changing configuration is not printed if the change
        !           573: is solely a descriptor coming from a source file.
1.1       oskar     574: .SH "SEE ALSO"
1.6       oskar     575: .BR repeatts (1),
                    576: .BR iso13818ps (1),
1.1       oskar     577: .BR ISO\ 13818-1 ,
                    578: .BR ETSI\ EN\ 300\ 468 .
                    579: .SH AUTHOR
                    580: Oskar Schirmer (oskar@convergence.de).

LinuxTV legacy CVS <linuxtv.org/cvs>