[FFmpeg-devel] [PATCH] metadata API is now ready to be part of public API

Aurelien Jacobs aurel
Sun Mar 1 15:47:01 CET 2009

On Sat, 28 Feb 2009 18:56:21 -0500
Justin Ruggles <justin.ruggles at gmail.com> wrote:

> Aurelien Jacobs wrote:
> > Hi,
> > 
> > I think the new metadata API is now ready to be used in the wild.
> > So attached patch makes it officially part of public API.
> > Note that all (de)muxers are now using this new API.
> > 
> > The only step left for this transition is to disable old API for
> > next major version, and to document this deprecation.
> What do you think about adding a generic api function to append to an
> existing entry instead of replacing it?  I'm thinking in terms of
> formats like vorbiscomment which explicitly allow duplicate entries for
> the same key.  Something like:
> int av_metadata_append(AVMetadata **pm, const char *key, const char
> *value, const char *separator);

The whole metadata API is based on the concept that there can't be
several keys with the same semantic. Please read the API doc,
especially point 1:

 * Important concepts to keep in mind:
 * 1. Keys are unique; there can never be 2 tags with the same key. This is
 *    also meant semantically, i.e., a demuxer should not knowingly produce
 *    several keys that are literally different but semantically identical.
 *    E.g., key=Author5, key=Author6. In this example, all authors must be
 *    placed in the same tag.

If we wanted to allow several keys with the same name, we would have to
change *every* muxer so that for *every* key it iterates to see if there
isn't several keys with the same name. And if they are several, every
muxer would have to handle this and "concatenate" the values.
With the restriction of point 1 cited above, only the very few format
which support repeated use of the same key need some special code to
handle it.
Oh, and patch welcome for the ogg demuxer to concatenate all the fields
with the same key name in a single metadata tag.


More information about the ffmpeg-devel mailing list