[Live-devel] How to mux a MPEG-4 video and audio stream into a MPEG-2 TS

Ross Finlayson finlayson at live555.com
Tue Jun 3 08:01:35 PDT 2008


>I'm trying to multiplex a raw MPEG-4 bytestream and AAC audio bytestream
>into a MPEG-2 Transport stream. I have a test program in which I take
>the audio and video streams and mux them together into a MPEG-2
>Transport stream.
>
>My program does successfully mux the video into a MPEG-2 TS. My problem
>is that the audio doesn't play when I play the Transport stream back
>using VLC. The video plays back fine, but I can't hear the audio. After
>analyzing the Transport stream I was able to verify that there are PIDs
>for both video and audio.
>
>Does anyone know what steps are involved to multiplex a AAC stream into
>a MPEG-2 Transport stream using live555?

Are you sure that - in your code - the "mpegVersion" parameter is 4 
when "MPEG2TransportStreamMultiplexor::handleNewBuffer()" gets called?

The problem may be that the current Transport Stream multiplexing 
(i.e., construction) code - implemented by the 
"MPEG2TransportStreamMultiplexor" class - originally assumed that the 
constituent audio and video streams were both MPEG-1 or MPEG-2; there 
was originally no support for MPEG-4 audio or video.

Since then, support was added for MPEG-4 audio and video.  However, 
it's conceivable that there are still problems with this.

You may want to take a look at "MPEG2TransportStreamMultiplexor.cpp" 
- in particular, the "if" statement that starts at line 108.  If you 
find something that needs to be changed there, please let us know.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list