[Ffmpeg-devel] Patch add function to read record time in dv video

Fred Rothganger rothgang
Sun Sep 4 17:18:06 CEST 2005

Michael Niedermayer wrote:

>patch looks ok, roman, do you agree with that? IIRC we had some
>disagreements in the past about how to pass this info around

    Not to be too self-critical, but I think this is a pretty hacky way 
to do it.  A nice way might be to put metadata in a name-value list 
attached to some appropriate structure, or perhaps have a standard 
function for probing metadata.  For example:

AVInputFormat {
    int (*metadata)(AVFormatContext *, char * name, void * value, int * 

The semantics of the names would be defined by the individual format, 
but there would be a lot of commonality between codecs.  The value would 
be an arbitrary structure, but well-defined for the given name.  For 
example, it could be a null terminated string or a time structure, etc.  
"size" would be the size of the structure.

The function would return metadata in the following priority order:
    * Relative to the most recently decoded frame
    * Relative to the container as a whole

If there are multiple streams and we want to be stream specific, a 
metadata function could be added to AVCodec as well, or perhaps stream 
could be one of the parameters of the function.

This approach could replace some of the metadata currently hard-coded 
into AVFormatContext, such as title, author, copyright, etc.  For 
writing such values to a stream, a metadata function can be added to 

-- Fred

More information about the ffmpeg-devel mailing list