[FFmpeg-devel] [PATCH] mp4 and ipod metadata

Michael Niedermayer michaelni
Wed Jun 11 21:39:58 CEST 2008

On Wed, Jun 11, 2008 at 11:46:47AM -0700, Baptiste Coudurier wrote:
> Michael Niedermayer wrote:
> > On Wed, Jun 11, 2008 at 02:55:47AM -0700, Baptiste Coudurier wrote:
> > [...]
> >>> That doesnt mean ipod tags should be in -f mp4 or -f mov but that
> >>> there is a -f foobar that contains all tags of all variants. I prefer
> >>> if i dont need to have each video 3 times so it can be played on 3
> >>> different players.
> >> I understand the need, Im afraid it's complicated.
> >>
> >> Unfortunately, it is so brainded to deal with all iso media variants and
> >> their fields having different meaning values that I tend to prefer
> >> constraining specific features to specific formats.
> >> I think that adding this ipod format was a good thing.
> > 
> > Could you point at a few examples were fields have different meaning
> > between mp4 types (not mp4 vs. mov)?
> mp4/3gp channels field in stsd for example, which is reserved to 2 while
> in mj2/mov it is actual channels number.

hmm, soo many specs to read and compare :(

Lets see if i can make some sense of them

ISO/IEC 14496-12:2005(E)
says about stsd:
Multiple descriptions may be used within a track.

The 'protocol' and 'codingname' fields are registered identifiers that uniquely identify the streaming protocol or
compression format decoder to be used. A given protocol or codingname may have optional or required
extensions to the sample description (e.g. codec initialization parameters). All such extensions shall be within
boxes; these boxes occur after the required fields. Unrecognized boxes shall be ignored.

So we may have multiple stsd boxes and ones with unknown "codingname" must
be ignored.

class AudioSampleEntry(codingname) extends SampleEntry (codingname){
   const unsigned int(32)[2] reserved = 0;
   template unsigned int(16) channelcount = 2;
   template unsigned int(16) samplesize = 16;
   unsigned int(16) pre_defined = 0;
   const unsigned int(16) reserved = 0 ;
   template unsigned int(32) samplerate = {timescale of media}<<16;
8.16.3 Semantics
    version is an integer that specifies the version of this box
    entry_count is an integer that gives the number of entries in the following table
    SampleEntry is the appropriate sample entry.
    data_reference_index is an integer that contains the index of the data reference to use to retrieve
       data associated with samples that use this sample description. Data references are stored in Data
       Reference Boxes. The index ranges from 1 to the number of data references.
    ChannelCount is either 1 (mono) or 2 (stereo)
So if i understand the base format does not require ChannelCount to be 2
but says=2 in the table

3gp which is based on the iso base format says reserved_2 for the field but
does not say anything about channels. Thus it appears it has been copy and
pasted but the description has not.

Neither does specify what the word "reserved" means.

So IMHO this is a typo in the spec. Or maybe reserved just means "unless
another ISO spec says something else". Of course this is guessing the
spec is not clear, it uses undefined terms.

Besides as long as the codingname differs between specs no conflict exists
when we store 2 stsd.

IMHO maybe we should just store the channel num there, the base spec says
thats ok and the other specs are quite unclear ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- 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/20080611/de4c75eb/attachment.pgp>

More information about the ffmpeg-devel mailing list