[FFmpeg-devel] [PATCH] code to parse mpeg4audio extradata

Michael Niedermayer michaelni
Thu Mar 27 15:04:38 CET 2008


On Thu, Mar 27, 2008 at 10:30:43AM +0100, Baptiste Coudurier wrote:
> Hi,
> 
> Michael Niedermayer wrote:
> > On Thu, Mar 27, 2008 at 12:42:56AM +0100, Baptiste Coudurier wrote:
> >> Hi,
> >>
> >> Michael Niedermayer wrote:
> >>> On Wed, Mar 26, 2008 at 10:14:47PM +0100, Andreas ?man wrote:
> >>>> Michael Niedermayer wrote:
> >>>>> On Wed, Mar 19, 2008 at 04:54:03PM +0100, Baptiste Coudurier wrote:
> >>>>>> Hi,
> >>>>>>
> >>>>>> Here is a patch that adds parsing of mpeg4audio extradata, and retrieve
> >>>>>> needed infos for decoders (only mp3on4 atm, but will be needed for aac),
> >>>>>> and will be used by mov demuxer ideally to correctly compute sample rate
> >>>>>> and channels.
> >>>>>> Also extract common mpeg4audio code from aac_parser.c.
> >>>>> Iam fine with this in priciple but i am unsure if the code does not maybe
> >>>>> rather belong to libavformat.
> >>>> If the AAC decoder should reuse the code i don't think it could belong
> >>>> in lavf.
> >>> Please elaborate
> >>> my idea was that the mp4 demuxer would use this code to extract the various
> >>> thing from the mp4 atoms in .mp4 and set things like sample_rate,...
> >>> But maybe i misunderstood something?
> >>>
> >> Yes, the code will also be used by mp3on4 and aac decoders to fetch
> >> sample rate, channels, sbr info from extradata. All decoders using
> >> MPEG-4 audio system will do that basically.
> > 
> > From what you say it sounds like this clearly belongs in the mp4 demuxer
> > and not in every decoder which could be stored in mp4.
> > 
> 
> Huh, I don't understand.
> How are decoders supposed to parse extradata, AAC GASpecificConfig for
> example ? Duplicate the code ?

extradata should contain
GASpecificConfig/CelpSpecificConfig/HvxcSpecificConfig/... (only one of
these should be there)

The surrounding parts belong to the demuxer. The first 5? bits are yet
another codec tag. That is what is used to identify mp3on4. And ironically
this is the correct way to identify audio codecs it seems
14496-3 FCD says:

3.2.1 objectProfile
A four bit field indicating the object profile. This is the master switch which selects the actual bit stream
syntax of the audio data. In general, different object profiles use a different bit stream syntax. The
interpretation of this field is given in the Object Profiles table above.

.mp4 is a mess even worse than ogg and mkv

Every time i read a little of the spec i understand a little bit more and am
more disgusted by it.


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080327/caf50341/attachment.pgp>



More information about the ffmpeg-devel mailing list