[Ffmpeg-devel] 4XM audio codec_tag

Måns Rullgård mru
Mon Nov 6 14:33:54 CET 2006


Michael Niedermayer said:
> Hi
>
> On Mon, Nov 06, 2006 at 02:55:14AM +0000, M?ns Rullg?rd wrote:
>> Diego Biurrun <diego at biurrun.de> writes:
>> > So please remind me: What is the problem with storing arbitrary
>> > audio and video formats in multimedia containers, especially generic
>> > ones?
>>
>> The format needs to be able to store global headers (aka extradata),
>> and it needs some way of identifying the codec.  The extradata part is
>> easy: either there is a place for it or there isn't.  If the format
>> can't accommodate an extradata chunk, codecs that need it can't be
>> used.  To identify the codec, format specifications typically include
>> a list of tag/codec pairs.  Any codec in this list can be stored using
>> the format in question.  If the codec is not in the list, it is of
>> course possible to invent a tag.  The problem with this approach is
>> that nobody else will know what this tag means, and thus nobody else
>> will be able to play the file.  Is this really so difficult to
>> understand?
>
> yes, a codec has a name, and often a fourcc which is used in many

Wrong.  A codec has a name.  A fourcc is not an inherent property of a
codec.  It is something that might be used to identify it in one particular
file format.  If a file format does not specify a fourcc/tag for some
codec, that codec can't be portably used in that file format.  Period.

> containers, if you use that its not hard to identify it
> what you say is like that you would need to make and maintain
> a list of all human names per form which contains a field for name
> it makes no sense

That sentence doesn't make any sense.

> if i use the fourcc 4xmv, asv1, roq or ... in mov, its clear what
> format that is
> for a human its clear at once, for a applicaton its clear as soon
> as it looks in the common codec_tag table

There is no bloody common codec_tag table.  EACH FORMAT HAS ITS OWN TABLE.
As it happens, there are rather few conflicts between the tables used by
different formats, so merging the tables might just work.  That doesn't
make it the architecturally correct thing to do, and for writing it is
blatantly stupid.

> btw, how does tcvp handle the fourcc <-> codec_id mapping?

By using one table per file format of course.  For formats handled by lavf,
the codec_id is mapped to an internal identifier that is then used to select
the codec.  When muxing, the internal ID is mapped, using the same per-format
tables, to the output format's tag for the codec.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list