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

Paul Kendall paul
Sat Apr 25 07:16:17 CEST 2009

On Friday 24 April 2009 10:17:47 pm Paul Kendall wrote:
> On Wednesday 22 April 2009 09:30:42 pm David Conrad wrote:
> > In general, in ffmpeg parsers split a stream into discrete, correct
> > frames/packets without changing the actual bitstream, and maybe do
> > some stuff with timestamps. So if you compared the concatenated
> > bitstream before and after the parser, it should be the same for all
> > of ffmpeg's current parsers (I think, I haven't looked at every parser.)
> >
> > I don't know whether you need a parser for latm (it depends on whether
> > mpeg-ts is guaranteed to give you the correct packet boundaries). If
> > you do need one, the parser you already have should suffice, though
> > ideally CODEC_ID_AAC_LATM would not be needed. Either way, the stream
> > should have CODEC_ID_AAC after the bitstream filter.
> >
> > As for extradata handling, the closest example in ffmpeg I can think
> > of is H.264, where the decoder can handle both mp4 style (separate
> > extradata) and annex B directly, and the h264_mp4toannexb bitstream
> > filter converts between the two.
> Ok, Ive modified the decoder to a bit stream filter. Basically this was
> just cutting out the code that fed the unwrapped stream to FAAD.
> I've go a capture of mpeg-ts data that I used previously with the decoder
> and I'm wanting to test that the filter is working. So, my question is,
> what's the best way to test it?
> ./ffmpeg -y -absf latm -acodec copy -vn -i input.ts out.aac
> I was hoping that this would use the LATM parser, which it does, then
> pass that to the bsf, then copy the result to the out.aac file.
> Problem is it's not going into the bsf! I get this output if it helps.
It seems that ffmpeg (the binary) uses bit stream filters after encoding
frames! So it's not going to work terribly well for decoding LATM/AAC.

I assume then that I am going to have to have my own test program
that uses av_bitstream_filter_filter before calling avcodec_decode_audio
to test the filter.

Am I going down the right track here. I really don't want to waste time
and effort that can be spent heading in the right direction.


More information about the ffmpeg-devel mailing list