[Live-devel] Streaming MPEG2 TS with separate audio and video input

Gustaf Räntilä opera at kth.se
Wed Mar 14 08:46:23 PDT 2007


Ross Finlayson wrote:
>> Hi,
>>
>> I'd like to stream (with rtsp) a transport stream of MPEG2 to an amino.
>> It works well for single files muxed with video and audio (using the
>> technique as for the onDemand-test-program, with a test.ts file). But
>> I'd like to use one video file and one audio file. When using two
>> instances of :
>> sms->addSubsession(MPEG2TransportFileServerMediaSubsession::createNew(...));
>> the players (amino, mplayer, vlc) dies or halts. Mplayer says it
>> received two video streams.
>>
>> Is there a solution for how to accomplish this, or do I have to use
>> pre-muxed single files?
>>
>> Note; The output stream needs to be bundled as a TS.
>>     
>
> Yes, you can multiplex the input audio and video streams together 
> into a single Transport Stream, and stream that.  You would do this 
> using a subclass of "MPEG2TransportStreamMultiplexor" - e.g., 
> "MPEG2TransportStreamFromESSource.hh".
>
> For example, look at how the "wis-streamer" code 
> <http://www.live555.com/wis-streamer/> combines separate audio and 
> video sources into a single Transport Stream - see 
> "WISMPEG2TransportStreamServerMediaSubsession.cpp".
>   
These solutions are very complex and unfortunately not really doing what 
I need.
To stream many simultaneous TS streams without using too much CPU, I 
would like to not have to transcode the sources.
So what I want is to read a video TS file and an audio TS file (AC3 for 
instance) and stream as a muxed TS. Is this possible?
I can't find any class for reading AC3 files for instance. Am I supposed 
to write my own AC3-reader and subclass some FrameSource-thing?

As I wrote, I tried to add an MPEG2TransportFileServerMediaSubsession 
and added it to a ServerMediaSession which works (if I only add one 
video file). Tried by adding an audio file (as TS) but when I play, 
mplayer says it received two video streams. To me it seems that 
MPEG2TransportFileServerMediaSubsession only reads _video_ TS files, 
which the class name doesn't really state.

The examples from the WiS contains a lot of reading V4L-files etc. I 
want to read video and audio TS files into ServerMediaSubsessions. Is 
there no support for this?

Gustaf


More information about the live-devel mailing list