[FFmpeg-devel] [PATCH] LATM Parser & LATM/AAC Decoder

Paul Kendall paul
Wed Apr 22 08:21:52 CEST 2009


On Wednesday 22 April 2009 06:08:35 pm David Conrad wrote:
> On Apr 22, 2009, at 1:34 AM, Paul Kendall wrote:
> > On Wednesday 22 April 2009 05:28:40 pm Diego Biurrun wrote:
> >> On Wed, Apr 22, 2009 at 04:33:47PM +1200, Paul Kendall wrote:
> >>> On Tuesday 21 April 2009 01:46:43 am Robert Swain wrote:
> >>>> On 20/4/09 08:11, Paul Kendall wrote:
> >>>>> After a long delay and some thinking...
> >>>>> The first patch is for a LATM Parser and LATM/AAC Decoder using
> >>>>> libfaad2. The second patch is to add support for LATM to mpegts&
> >>>>> mpeg.
> >>>>>
> >>>>> Please comment and I'll endeavor to to get any fixes done ASAP.
> >>>>
> >>>> - The bitstream parser should not be tied to any one decoder
> >>>> implementation. It should at least work (non-hackishly) with both
> >>>> libfaad and ffaac.
> >>>
> >>> Once ffaac can do HE-AAC I'd prefer to remove libfaad support
> >>> permanently.
> >>
> >> ffaac should gain HE-AAC support somewhen this year.  Once this has
> >> reasonably stabilized, libfaad support will be removed.
> >>
> >> But even in the meantime the LATM parser should not be tied to
> >> libfaad.
> >
> > Agreed, how do I make it support both codecs? How would a user or an
> > application choose which decoder the data should be sent to?
>
> Make an AVBitStreamFilter or AVParser (bitstream filter is probably
> more appropriate) that takes LATM wrapped AAC and extracts a raw AAC
> bitstream, then add a way to get it to automatically use it in the ts
> demuxer. Then the standard mechanisms (-codec for ffmpeg) will allow
> choosing between multiple plain AAC decoders. As an added plus, this
> won't horribly break codec copy.

Using a bitstream filter is a good idea.
>From what I understand, you need a parser, which then has a split which
extracts the extradata (used by an AAC decoder to figure out the channels
and sampling frequency etc). Then a bitstream filter (which has all the same
code as split!) to remove the LATM and leave the raw AAC from the stream.

If I'm wrong here, please correct me and I'll consider doing it this way if
it's the preferred method.

>
> > This also means that the LATM support needs to be built into the
> > ffmpeg
> > AAC decoder.
>
> Why would any AAC decoder need to know anything about LATM?

The only reason is that the only use of LATM that I have seen in the wild
is for digital terrestrial TV with AAC data in it!

Paul



More information about the ffmpeg-devel mailing list