[Live-devel] How to convert MPEG1/2 elementary streams to separate program streams?

Ross Finlayson finlayson at live.com
Tue Sep 20 14:56:35 PDT 2005


At 06:42 AM 9/20/2005, you wrote:
>How an elementary stream can be converted to a program stream? More 
>specifically , I am in-fact getting an MPEG1/2 elementary stream 
>from Live's RTP server according to RFC 2250. Now after getting this 
>ES, i want to change that individual ES to program stream. So 
>obviously two separate program streams will be created and each of 
>these PS will contain separately an audio and video data.
>I thought of following approach ----> Whenever a sequence_header 
>arrives in RTP packet, start writing the media data to a file until 
>the next sequence_header. Now add sequence_end code ( 0x000001B7) 
>and program_end code  ( 0x000001B7) at the last of the file. But 
>obvious problem i am facing is that the players can't play that 
>program stream. This may be due to absence PACK_header and program 
>stream specific data. How to form those necessary data ?
>Any help in this matter will be highly helpful.

There's nothing currently in the "LIVE.COM Streaming Media" code that 
will convert an MPEG Elementary Stream into a Program Stream.  If you 
want to do this yourself, however, don't forget to accumulate the 
Elementary Stream data into 'PES packets', and add a PES header 
before writing it to the Program Stream.

You should consult the MPEG specs for more details...


	Ross Finlayson
	Live Networks, Inc. (LIVE.COM)
	<http://www.live.com/>



More information about the live-devel mailing list