Is there a free docume开发者_Python百科ntation for getting the Transport Stream from UDP packets captured from the network?
There are two ways of transporting a MPEG2 transport stream in UDP. One is two just place a couple of MPEG2 TS frames into a UDP packet. The other is to put a number of frames into an RTP packet (which itself is the payload of a UDP packet). The Wikipedia entry is a good starting point for the format. If the first byte in your UDP packet is 0x47, it's most likely TS in plain UDP. If it is something else, it's usually MPEG2 TS in RTP.
If it is RTP, you have to skip the header to find the begin of the payload. See the RfC for details.
精彩评论