[FFmpeg-devel] [PATCH] metadata conversion API

Baptiste Coudurier baptiste.coudurier
Sat Feb 28 01:44:29 CET 2009

On 2/27/2009 4:30 PM, Aurelien Jacobs wrote:
> Baptiste Coudurier wrote:
>> On 2/25/2009 5:13 PM, Aurelien Jacobs wrote:
>>> Hi,
>>> There is one last and important issue I want to address with the new
>>> metadata API.
>>> Old API allowed client apps and muxers to get a few select well known
>>> tags (title, author...). With the new API, there is no simple way to
>>> do that, right now. For example, if you demux an ASF file, and want to
>>> get the name of the album, av_metadata_get(..., "album", ...) won't
>>> give you any results, because ASF stores this information in a tag
>>> named "AlbumTitle". There are lots of examples with various demuxers,
>>> even for simple common tags. This also prevent correct remuxing between
>>> different containers.
>> First, thanks for your work Aurel, this is greatly appreciated.
> You're welcome :-)
>> I have a few ideas:
>> Would it be possible to also export container information as "metadata" ?
> This is definitely possible.
>> Like aspect ratio, width, height. This would avoid duplicating fields
>> from AVCodecContext, and make this information available as a simple way
>> to user wanting for example to use libavformat to retrieve media
>> information.
> I think it highly depends on the target usage of the various fields you
> want to export. If those fields are mostly targeted for textual user
> information, using metadata is probably the way to go. But if the fields
> are mostly targeted for numerical parameters to the software, then
> metadata may not be the most practical way go.

It would be easy atoi/atoll value though.
I will propose again my solution to have some "type" field where we
could set "INT", "INT64", "UTF8", "RATIONAL", etc...

I don't think it might be too bloated, and would be really generic and
useful. We have too many fields in AVCodecContext IMHO.

I don't feel too worried about handling "width", "720" personnaly.

>> Then I might think it could be great to also enable AVMetadata for
>> libavcodec and let codecs export some metadata in a generic way, instead
>> of adding a field to AVCodecContext for each item.
> Could be possible, but I wonder what kind of data you would export this
> way. Do you have examples ?

Information like vbv buffer size, vbv delay for mpeg-2, interlaced,
etc.. but it could be metadata from eac-3, I don't know.

> Also, would you use this to pass data (parameters?) to encoders ?

Not necessearly. This is mainly aiming at offering user a way to
retrieve information from the file in a generic and easy way.

Although, now I can see this coudl be a way to supply x264 cli options
to the libx264 wrapper, without cluttering AVOptions.

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list