[Mp4-tech] MPEG-2 TS converter

Alejandro Moya almomo1 gmail.com
Thu Jun 2 17:27:05 EDT 2005


You needn't insert PMT or PAT periodically because what our friend
Ik-Hwan asked was the way to convert one program stream into a TS for
testing pourposes, not for streaming: when you broadacast a TS, even
if it has only one program, you need to insert PMT or PAT so decoders
can be able to get the program list and their associated PIDs; thatis
not needed when using a TS inside a file.
"continuity counters " aren't needed either and "payload_unit_start"
bit is set in the byte sequence I told him to insert as transport
stream header.
The only thing I forgot to comment to make an easy test TS was that
each transport packet should be 188 bytes length, so PMT and PAT
packets should be padded with byte 0xFF.
Regards.
2005/6/2, Samuel Rivas <samuel dc.fi.udc.es>:
> Alejandro Moya wrote:
> > Dear Ik.Hwan Cho,
> > converting MPEG-2 Program stream into one Transport Stream could notbe difficult if you just to mux one program into the TS without timinginformation: you should remove Pack and System Headers from ProgramStream and should divide the resulting Packets into 184 byte chunksadding an easy 4 byte header -> 0x47 0x0Y 0xYY 0x10 where "Y" are 13bits indicating your Program IDentification (you may choose it as youdesire). The last step would be to add two packets at the beginning ofthe file containing your new TS: one with Program Association Table(Tranport Stream which should have PID = 0) and Program Map Table(which will have the PID you defined in the Program Association Table)containing the PIDs of the transport stream packets carrying youroriginal video (i.e., the PID  "Y" you choose above).
> 
> It is is not so easy. TS packets need stuffing if payload is less
> than 184 bytes length, you must set the continuity counters and the
> payload_unit_start indicators, PAT and PMT should be inserted
> periodically, etc.
> 
> An easy way to get a more or less correct transport stream is using Video
> Lan Client (http://www.videolan.org/vlc/)
> 
> --
>        Samuel
> _______________________________________________
> NOTE: Please use clear subject lines for your posts. Include [audio, [video], [systems], [general] or another apppropriate identifier to indicate the type of question you have.
> 
> Note: Conduct on the mailing list is subject to the Antitrust guidelines found at http://www.mpegif.org/public/documents/vault/mp-out-30042-Antitrust.php
>



More information about the Mp4-tech mailing list