[MPlayer-dev-eng] [PATCH] support for mpeg transport streams in rtp

Chas Williams (CONTRACTOR) chas at cmf.nrl.navy.mil
Fri Apr 30 19:07:09 CEST 2010


In message <201004301824.10083.nicola.sabbi at poste.it>,Nico Sabbi writes:
>Il venerd=EC 30 aprile 2010 18:08:46 Chas Williams (CONTRACTOR) ha =
>
>scritto:
>> per rfc 2250, you need to skip an additional 4 bytes of header for
>> mpeg transport streams.  if you dont do this, the demuxer cant
>> detect the mpeg transport stream.
>>
>> Index: stream/rtp.c
>>                         =
>                         =
>                  
>> --- stream/rtp.c	(revision 31105)
>> +++ stream/rtp.c	(working copy)
>> @@ -246,6 +246,9 @@
>>
>>    headerSize   12 + 4*rh->b.cc; /* in bytes */
>>
>> +  if (rh->b.pt    32)		/* 32   MPV from RFC 1890 */
>> +	headerSize +  4;	/* skip MPEG video-specific header RFC 2250 */
>> +
>>    *lengthData   lengthPacket - headerSize;
>>    *data   (char*) buf + headerSize;
>>
>
>
>Please, explain. MPV identified the 4-bytes mpeg audio or video =
>elementary stream. Does it precede the mpegts payload???

yes, mpeg video transport streams have header seperate from the rtp
header.  take a look at rfc 2250 and you will see:

	3.4 MPEG Video-specific header

	   This header shall be attached to each RTP packet after the RTP fixed
	   header.

	    0                   1                   2                   3
	    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
	   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	   |    MBZ  |T|         TR        | |N|S|B|E|  P  | | BFC | | FFC |
	   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
					   AN              FBV     FFV


note that there is another optional extended header whose presence is 
determined by the T-bit in the mandatory mpeg video header.  however,
i have never seen an rtp mpeg stream with optional extended header.



More information about the MPlayer-dev-eng mailing list