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

Michael Niedermayer michaelni
Thu Jun 12 22:56:55 CEST 2008


On Thu, Jun 12, 2008 at 12:37:18PM -0700, Baptiste Coudurier wrote:
> Michael Niedermayer wrote:
> > On Thu, Jun 12, 2008 at 11:35:18AM -0700, Baptiste Coudurier wrote:
> >> Michael Niedermayer wrote:
> >>> On Thu, Jun 12, 2008 at 10:13:49AM -0700, Baptiste Coudurier wrote:
> >>>> Hi Michael,
> >>>>
> >>>> Michael Niedermayer wrote:
> >>> [...]
> >>>>> Additionally 3gpp says: ----------------------- The file-type brands
> >>>>> defined in this specification are used to label 3GP files belonging
> >>>>> to Release 6 and conforming to one or more profiles. 3GP files may
> >>>>> also conform to earlier Releases or even to other file formats, such
> >>>>> as MP4, which is also derived from the ISO base media file format
> >>>>> [7]. Table 5.1 contains a non-exhaustive list of examples with 3GP
> >>>>> files for various purposes. All 3GP files of Release 5 
> >>>> AFAIK We are using Release 4 !
> >>> release 4 is from 2000/2001
> >>>
> >>> I really think we should try to be conformant to a recent version of it!
> >>> Especially if one considers that the mp4 and iso base formats arent
> >>> that old themselfs.
> >>>
> >>> Iam a little puzzled why you refuse to accept the more recent versions.
> >>> Versions that clarify that iso base compatibility and thus a valid
> >>> channel count is mandatory.
> >> What about old devices ? 
> > 
> > No device reads and depends on a reserved field that contains no
> > information.
> 
> Im pretty sure that devices (specially phones), check brands and
> compatible brands, first 3GP release is very old, and files we create
> are still compliant.

Yes, so we store 3gp6 3gp5 3gp4 and if needed 3gp4 as first one
and it should work fine.


[...]

> Besides, I have finally found it:
> 
> "  7. Template fields used
> 
> In the section ?Data Types and Fields? of the ISO Base Media File
> Format, the concept of ?template? fields is defined.  This specification
> derives from the base, and it is required that any derived specification
> state explicitly which template fields are used.  This format uses no
> template fields.
> 
> When a file is created as a pure MPEG-4 file, those fields shall be set
> to their default values.  If a file is multi-purpose and also complies
> with other specifications, then those fields may have non-default values
> as required by those other specifications.
> 
> When a file is read as an MPEG-4 file, the values in the template fields
> shall be ignored."

In ISO/IEC 14496-12:2005(E) Data Types and Fields says the following about
templates
---
Fields shown as "template" in the box descriptions are optional in the specifications that use this
specification. If the field is used in another specification, that use must be conformant with its definition here,
and the specification must define whether the use is optional or mandatory. Similarly, fields marked "pre-
defined" were used in an earlier version of this specification. For both kinds of fields, if a field of that kind is
not used in a specification, then it should be set to the indicated default value. If the field is not used it must
be copied un-inspected when boxes are copied, and ignored on reading.
----

"If the field is used in another specification, that use must be conformant with its definition here"
This means that if a spec is using channel count it has to be the
channel count. 3GP does not use it in this sense thus its the default value
unless another spec requires it to be the channel count.
aka reserved and value=2 (that is set aside for another spec and if none
does then set it to 2)


"If the field is not used it must
 be copied un-inspected when boxes are copied, and ignored on reading."
This requires any compliant 3gp demuxer to ignore channel count


> 
> So yes, we may set ChannelCount to either 1 or 2 for MPEG-4, in the
> sense that we are not creating "pure" MPEG-4, but I object to set it to
> 6 until ISO clarify, and I really do not understand why they do not clarify.

I do understand why they do not clarify. There is nothing to clarify.
There is a field which can contain either 2 (the default value) 
or the channel count.
Which it is depends on the brands one claims compatibility with.
If no spec explicitly says it uses the channel count then its value has
to be copied from the input unchanged by the muxer or set to the default
value of 2. If one or more specs say that they use the channel count field
then it has to be set to the true channel count.


> 
> Since the beginning, I really see not point forcing the specs while
> nothing is clear and stated, and everything else has MORE chance to
> break, really this is puzzling.
> 
> >> 3gp specs mandates value 2 for this field, like I proved many many times.
> > 
> > 3gp release 5 and later mandate iso media compatiblity that mandates this
> > value to be 1 for mono streams beyond doubt.
> 
> Again we are using release 4, and there is no valid reason to use 5.

There is no reason to have a dozen variants of the mp4 format generated by
our muxer.
We could generate one which is compliant to all specs except the psp one.
It would be nicer for our users and would give ffmpeg an advantage over other
more limited muxers.


> 
> > all 3gp specs ive seen mark the field as reserved not fixed=2. reserved is
> > not the same as fixed. A demuxer depending on the value of a reserved field
> > is broken.
> 
> This is false.

see above, the iso base explicitly requires unused template fields to be
ignored on the demuxer side.


> 
> The official 3gp spec is TS 26.244, and this document call this field
> Reserved_2, 

reserved_2 is 2 bytes reserved


> and set its value to 2 (check the value for All SampleEntry
> structures), since a long time (I checked your version which defines
> Release 5).

They are reserved, that is set aside for another spec to define, the value
2 is to be used when there is no other spec in use requiring a different
one.

the iso base format clearly states template fields used must be explicitly
declared
"Any template fields used must be explicitly declared; their use must be conformant with the specification here."

3gp clearly states which template fields it uses and explicitly
says that it does not use any others. channel count is not amongth the
used fields thus 3gp adds no requirement to the value of channel count
over what the iso base requires. Thus there is no incompatibility in
the value of channel count between the 2 specs.

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

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- 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/20080612/39ac5b08/attachment.pgp>



More information about the ffmpeg-devel mailing list