>
> Date: Wed, 15 Jul 2009 20:33:42 -0400
> From: "Gus Issa" <gu...@gh...>
> Subject: [mpeg2-dev] MPEG files with audio
> To: <lib...@li...>
> Message-ID: <81152BDD268B472E900E6D3DE171CA26@gusbo>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
> Does libmpeg2 decode MPEG files with audio in them? I know the library
> itself doesn't decode the audio but is there a way to get the audio data
> from the library since it is already parsing the MPEG file?
>
> Gus
>
> libmpeg2 itself won't extract the audio for you, but you can add it into
something like the demux function in the mpeg2dec example. In the section
that starts "switch (header[3]) {" in mpeg2dec, header[3] will have a
value of not less than 0xe0 and not more than 0xef if it is a video stream.
MPEG-1 and MPEG-2 audio streams will have a value >= 0xc0 and <= 0xcf. I'm
pretty sure that everything else in the audio header will look the same as
if it were a video stream, so if you just make a copy of the section in the
demuxer from mpeg2dec and change the value for header[3] (and change where
you send the audio data as well), you should have a working demultiplexer
that will handle audio as well.
I hope that is helpful.
Josh
|