[FFmpeg-devel] [RFC] flvenc: missing aac extradata

Yusuke Nakamura muken.the.vfrmaniac at gmail.com
Fri Apr 19 17:46:56 CEST 2013

2013/4/20 Michael Niedermayer <michaelni at gmx.at>

> On Thu, Dec 13, 2012 at 02:54:56PM +0100, Björn Axelsson wrote:
> > Problem found when remuxing mpegts (h264 + aac) to flv across pipes,
> > like this:
> > ffmpeg -f mpegts -i - -absf aac_adtstoasc -acodec copy -vcodec copy -f
> flv -
> >
> > The AAC extradata is needed for the FLV header in flv_write_header(),
> > but is not available at that time. This results in unusable audio in the
> > resulting FLV stream.
> >
> > We currently use something like the attached patch as a workaround, but
> > I'm sure someone can point me towards a better solution.
> how can the problem be reproduced?
> flv does not seem to support 48khz and all aac in ts i could find is
> 48khz

FLV supports 48kHz AAC.

Adobe Flash Video File Format Specification Version 10.1
If the SoundFormat indicates AAC, the SoundType should be 1 (stereo) and
the SoundRate should be 3 (44 kHz).
However, this does not mean that AAC audio in FLV is always stereo, 44 kHz
data. Instead, the Flash Player ignores
these values and extracts the channel and sample rate data is encoded in
the AAC bit stream.

More information about the ffmpeg-devel mailing list