The metadata API allows libavformat to export metadata tags to a client application when demuxing. More...
The metadata API allows libavformat to export metadata tags to a client application when demuxing.
Conversely it allows a client application to set metadata when muxing.
Metadata is exported or set as pairs of key/value strings in the 'metadata' fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs using the AVDictionary API. Like all strings in Libav, metadata is assumed to be UTF-8 encoded Unicode. Note that metadata exported by demuxers isn't checked to be valid UTF-8 in most cases.
Important concepts to keep in mind:
album -- name of the set this work belongs to album_artist -- main creator of the set/album, if different from artist. e.g. "Various Artists" for compilation albums. artist -- main creator of the work comment -- any additional description of the file. composer -- who composed the work, if different from artist. copyright -- name of copyright holder. creation_time-- date when the file was created, preferably in ISO 8601. date -- date when the work was created, preferably in ISO 8601. disc -- number of a subset, e.g. disc in a multi-disc collection. encoder -- name/settings of the software/hardware that produced the file. encoded_by -- person/group who created the file. filename -- original name of the file. genre -- <self-evident>. language -- main language in which the work is performed, preferably in ISO 639-2 format. Multiple languages can be specified by separating them with commas. performer -- artist who performed the work, if different from artist. E.g for "Also sprach Zarathustra", artist would be "Richard Strauss" and performer "London Philharmonic Orchestra". publisher -- name of the label/publisher. service_name -- name of the service in broadcasting (channel name). service_provider -- name of the service provider in broadcasting. title -- name of the work. track -- number of this work in the set, can be in form current/total. variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
Look in the examples section for an application example how to use the Metadata API.
Use non-blocking mode. If this flag is set, operations on the context will return AVERROR(EAGAIN) if they can not be performed immediately. If this flag is not set, operations on the context will never return AVERROR(EAGAIN). Note that this flag does not affect the opening/connecting of the context. Connecting a protocol will always block if necessary (e.g. on network protocols) but never hang (e.g. on busy devices). Warning: non-blocking protocols is work-in-progress; this flag may be silently ignored.
Create and initialize a AVIOContext for accessing the resource indicated by url.
s | Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL. |
flags | flags which control how the resource indicated by url is to be opened |
Create and initialize a AVIOContext for accessing the resource indicated by url.
s | Used to return the pointer to the created AVIOContext. In case of failure the pointed to value is set to NULL. |
flags | flags which control how the resource indicated by url is to be opened |
int_cb | an interrupt callback to be used at the protocols level |
options | A dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. |
Close the resource accessed by the AVIOContext s and free it. This function can only be used if s was opened by avio_open().
The internal buffer is automatically flushed before closing the resource.
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL. This function can only be used if s was opened by avio_open().
The internal buffer is automatically flushed before closing the resource.
Open a write only memory stream.
s | new IO context |
Return the written size and a pointer to the buffer. The buffer must be freed with av_free(). Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
s | IO context |
pbuffer | pointer to a byte buffer |
Iterate through names of available protocols.
opaque | A private pointer representing current protocol. It must be a pointer to NULL on first iteration and will be updated by successive calls to avio_enum_protocols. |
output | If set to 1, iterate over output protocols, otherwise over input protocols. |
Pause and resume playing - only meaningful if using a network streaming protocol (e.g. MMS).
pause | 1 for pause, 0 for resume |
Seek to a given timestamp relative to some component stream. Only meaningful if using a network streaming protocol (e.g. MMS.).
stream_index | The stream index that the timestamp is relative to. If stream_index is (-1) the timestamp should be in AV_TIME_BASE units from the beginning of the presentation. If a stream_index >= 0 is used and the protocol does not support seeking based on component streams, the call will fail with ENOTSUP. |
timestamp | timestamp in AVStream.time_base units or if there is no stream specified then in AV_TIME_BASE units. |
flags | Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE and AVSEEK_FLAG_ANY. The protocol may silently ignore AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will fail with ENOTSUP if used and not supported. |
Get the current time in microseconds.
Sleep for a period of time. Although the duration is expressed in microseconds, the actual delay may be rounded to the precision of the system timer.
usec | Number of microseconds to sleep. |
The metadata API allows libavformat to export metadata tags to a client application when demuxing. Conversely it allows a client application to set metadata when muxing.
Metadata is exported or set as pairs of key/value strings in the 'metadata' fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs using the AVDictionary API. Like all strings in Libav, metadata is assumed to be UTF-8 encoded Unicode. Note that metadata exported by demuxers isn't checked to be valid UTF-8 in most cases.
Important concepts to keep in mind:
album -- name of the set this work belongs to album_artist -- main creator of the set/album, if different from artist. e.g. "Various Artists" for compilation albums. artist -- main creator of the work comment -- any additional description of the file. composer -- who composed the work, if different from artist. copyright -- name of copyright holder. creation_time-- date when the file was created, preferably in ISO 8601. date -- date when the work was created, preferably in ISO 8601. disc -- number of a subset, e.g. disc in a multi-disc collection. encoder -- name/settings of the software/hardware that produced the file. encoded_by -- person/group who created the file. filename -- original name of the file. genre -- <self-evident>. language -- main language in which the work is performed, preferably in ISO 639-2 format. Multiple languages can be specified by separating them with commas. performer -- artist who performed the work, if different from artist. E.g for "Also sprach Zarathustra", artist would be "Richard Strauss" and performer "London Philharmonic Orchestra". publisher -- name of the label/publisher. service_name -- name of the service in broadcasting (channel name). service_provider -- name of the service provider in broadcasting. title -- name of the work. track -- number of this work in the set, can be in form current/total. variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
Look in the examples section for an application example how to use the Metadata API.