2016-12-05 21:12:24 +00:00
|
|
|
|
# Metadata
|
|
|
|
|
|
|
|
|
|
This draft recaps the current metadata handling in GStreamer and
|
|
|
|
|
proposes some additions.
|
|
|
|
|
|
|
|
|
|
## Supported Metadata standards
|
|
|
|
|
|
|
|
|
|
The paragraphs below list supported native metadata standards sorted by
|
|
|
|
|
type and then in alphabetical order. Some standards have been extended
|
|
|
|
|
to support additional metadata. GStreamer already supports all of those
|
2017-03-20 17:31:51 +00:00
|
|
|
|
to some extend. This is showns in the table below as either `[--]`,
|
|
|
|
|
`[r-]`, `[-w]` or `[rw]` depending on read/write support (08.Feb.2010).
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
|
|
### Audio
|
|
|
|
|
- mp3
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* ID3v2: `[rw]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.id3.org/Developer_Information
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* ID3v1: `[rw]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.id3.org/ID3v1
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* XMP: `[--]` (inside ID3v2 PRIV tag of owner XMP)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
- ogg/vorbis
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* vorbiscomment: `[rw]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.xiph.org/vorbis/doc/v-comment.html
|
|
|
|
|
* http://wiki.xiph.org/VorbisComment
|
|
|
|
|
- wav
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* LIST/INFO chunk: `[rw]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info
|
|
|
|
|
* http://www.kk.iij4u.or.jp/~kondo/wave/mpidata.txt
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* XMP: `[--]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
|
|
|
|
|
### Video
|
|
|
|
|
- 3gp
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* {moov,trak}.udta: `[rw]`
|
|
|
|
|
* http://www.3gpp.org/ftp/Specs/html-info/26244.htm
|
|
|
|
|
* ID3V2: `[--]`
|
|
|
|
|
* http://www.3gpp.org/ftp/Specs/html-info/26244.htm
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.mp4ra.org/specs.html#id3v2
|
|
|
|
|
- avi
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* LIST/INFO chunk: `[rw]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info
|
|
|
|
|
* http://www.kk.iij4u.or.jp/~kondo/wave/mpidata.txt
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* XMP: `[--]` (inside "_PMX" chunk)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
- asf
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* ??:
|
|
|
|
|
* XMP: `[--]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
2017-03-20 17:31:51 +00:00
|
|
|
|
- flv `[--]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* XMP: (inside onXMPData script data tag)
|
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
- mkv
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* tags: `[rw]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.matroska.org/technical/specs/tagging/index.html
|
|
|
|
|
- mov
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* XMP: `[--]` (inside moov.udta.XMP_ box)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
- mp4
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* {moov,trak}.udta: `[rw]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://standards.iso.org/ittf/PubliclyAvailableStandards/c051533_ISO_IEC_14496-12_2008.zip
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* moov.udta.meta.ilst: `[rw]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://atomicparsley.sourceforge.net/
|
|
|
|
|
* http://atomicparsley.sourceforge.net/mpeg-4files.html
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* ID3v2: `[--]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.mp4ra.org/specs.html#id3v2
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* XMP: `[--]` (inside UUID box)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
- mxf
|
|
|
|
|
* ??
|
|
|
|
|
|
|
|
|
|
### Images
|
|
|
|
|
- gif
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* XMP: `[--]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
- jpg
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* jif: `[rw]` (only comments)
|
|
|
|
|
* EXIF: `[rw]` (via metadata plugin)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.exif.org/specifications.html
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* IPTC: `[rw]` (via metadata plugin)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.iptc.org/IPTC4XMP/
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* XMP: `[rw]` (via metadata plugin)
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
- png
|
2017-03-20 17:31:51 +00:00
|
|
|
|
* XMP: `[--]`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
* http://www.adobe.com/devnet/xmp/
|
|
|
|
|
|
|
|
|
|
### further Links:
|
|
|
|
|
|
|
|
|
|
http://age.hobba.nl/audio/tag_frame_reference.html
|
|
|
|
|
http://wiki.creativecommons.org/Tracker_CC_Indexing
|
|
|
|
|
|
|
|
|
|
## Current Metadata handling
|
|
|
|
|
|
|
|
|
|
When reading files, demuxers or parsers extract the metadata. It will be
|
2017-03-20 17:31:51 +00:00
|
|
|
|
sent a `GST_EVENT_TAG` to downstream elements. When a sink element
|
|
|
|
|
receives a tag event, it will post a `GST_MESSAGE_TAG` message on the
|
2016-12-05 21:12:24 +00:00
|
|
|
|
bus with the contents of the tag event.
|
|
|
|
|
|
2017-03-20 17:31:51 +00:00
|
|
|
|
Elements receiving `GST_EVENT_TAG` events can mangle them, mux them into
|
2016-12-05 21:12:24 +00:00
|
|
|
|
the buffers they send or just pass them through. Usually is muxers that
|
|
|
|
|
will format the tag data into the form required by the format they mux.
|
2017-03-20 17:31:51 +00:00
|
|
|
|
Such elements would also implement the `GstTagSetter` interface to receive
|
2016-12-05 21:12:24 +00:00
|
|
|
|
tags from the application.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
+----------+
|
|
|
|
|
| demux |
|
|
|
|
|
sink src --> GstEvent(tag) over GstPad to downstream element
|
|
|
|
|
+----------+
|
|
|
|
|
|
|
|
|
|
method call over GstTagSetter interface from application
|
|
|
|
|
|
|
|
|
|
|
v
|
|
|
|
|
+----------+
|
|
|
|
|
| mux |
|
|
|
|
|
GstEvent(tag) over GstPad from upstream element --> sink src
|
|
|
|
|
+----------+
|
|
|
|
|
```
|
|
|
|
|
|
2017-03-20 17:31:51 +00:00
|
|
|
|
The data used in all those interfaces is `GstTagList`. It is based on a
|
|
|
|
|
`GstStructure` which is like a hash table with differently typed entries.
|
2016-12-05 21:12:24 +00:00
|
|
|
|
The key is always a string/GQuark. Many keys are predefined in GStreamer
|
|
|
|
|
core. More keys are defined in gst-plugins-base/gst-libs/gst/tag/tag.h.
|
|
|
|
|
If elements and applications use predefined types, it is possible to
|
|
|
|
|
transcode a file from one format into another while preserving all known
|
|
|
|
|
and mapped metadata.
|
|
|
|
|
|
|
|
|
|
## Issues
|
|
|
|
|
|
|
|
|
|
### Unknown/Unmapped metadata
|
|
|
|
|
|
2017-03-20 17:31:51 +00:00
|
|
|
|
Right now GStreamer can lose metadata when transcoding and/or remuxing
|
|
|
|
|
content. This can happens as we don’t map all metadata fields to generic
|
2016-12-05 21:12:24 +00:00
|
|
|
|
ones.
|
|
|
|
|
|
2017-03-20 17:31:51 +00:00
|
|
|
|
We should probably also add the whole metadata blob to the `GstTagList`.
|
|
|
|
|
We would need a `GST_TAG_SYSTEM_xxx` define (e.g.
|
|
|
|
|
`GST_TAG_SYSTEM_ID3V2`) for each standard. The content is not printable
|
2016-12-05 21:12:24 +00:00
|
|
|
|
and should be treated as binary if not known. The tag is not mergeable -
|
2017-03-20 17:31:51 +00:00
|
|
|
|
call `gst_tag_register()` with `GstTagMergeFunc=NULL`. Also the tag data
|
2016-12-05 21:12:24 +00:00
|
|
|
|
is only useful for upstream elements, not for the application.
|
|
|
|
|
|
|
|
|
|
A muxer would first scan a taglist for known system tags. Unknown tags
|
|
|
|
|
are ignored as already. It would first populate its own metadata store
|
|
|
|
|
with the entries from the system tag and the update the entries with the
|
|
|
|
|
data in normal tags.
|
|
|
|
|
|
2017-03-20 17:31:51 +00:00
|
|
|
|
Below is an initial list of tag systems: `ID3V1` - `GST_TAG_SYSTEM_ID3V1`
|
|
|
|
|
`ID3V2` - `GST_TAG_SYSTEM_ID3V2` `RIFF_INFO` -
|
|
|
|
|
`GST_TAG_SYSTEM_RIFF_INFO` XMP - `GST_TAG_SYSTEM_XMP`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
|
|
|
|
|
We would basically need this for each container format.
|
|
|
|
|
|
|
|
|
|
See also <https://bugzilla.gnome.org/show_bug.cgi?id=345352>
|
|
|
|
|
|
|
|
|
|
### Lost metadata
|
|
|
|
|
|
|
|
|
|
A case slighly different from the previous is that when an application
|
2017-03-20 17:31:51 +00:00
|
|
|
|
sets a `GstTagList` on a pipeline. Right elements consuming tags do not
|
2016-12-05 21:12:24 +00:00
|
|
|
|
report which tags have been consumed. Especially when using elements
|
|
|
|
|
that make metadata persistent, we have no means of knowing which of the
|
|
|
|
|
tags made it into the target stream and which were not serialized.
|
|
|
|
|
Ideally the application would like to know which kind of metadata is
|
|
|
|
|
accepted by a pipleine to reflect that in the UI.
|
|
|
|
|
|
2017-03-20 17:31:51 +00:00
|
|
|
|
Although it is in practise so that elements implementing `GstTagSetter`
|
2016-12-05 21:12:24 +00:00
|
|
|
|
are the ones that serialize, this does not have to be so. Otherwise we
|
|
|
|
|
could add a means to that interface, where elements add the tags they
|
|
|
|
|
have serialized. The application could build one list from all the tag
|
|
|
|
|
messages and then query all the serialized tags from tag-setters. The
|
|
|
|
|
delta tells what has not been serialized.
|
|
|
|
|
|
|
|
|
|
A different approach would be to query the list of supported tags in
|
2017-03-20 17:31:51 +00:00
|
|
|
|
advance. This could be a query (`GST_QUERY_TAG_SUPPORT`). The query
|
2016-12-05 21:12:24 +00:00
|
|
|
|
result could be a list of elements and their tags. As a convenience we
|
|
|
|
|
could flatten the list of tags for the top-level element (if the query
|
|
|
|
|
was sent to a bin) and add that.
|
|
|
|
|
|
|
|
|
|
### Tags are per Element
|
|
|
|
|
|
|
|
|
|
In many cases we want tags per stream. Even metadata standards like
|
2017-03-20 17:31:51 +00:00
|
|
|
|
mp4/3gp metadata supports that. Right now `GST_MESSAGE_SRC(tags)` is the
|
2016-12-05 21:12:24 +00:00
|
|
|
|
element. We tried changing that to the pad, but that broke applications.
|
2017-03-20 17:31:51 +00:00
|
|
|
|
Also we miss the symmetric functionality in `GstTagSetter`. This interface
|
2016-12-05 21:12:24 +00:00
|
|
|
|
is usually implemented by
|
|
|
|
|
elements.
|
|
|
|
|
|
|
|
|
|
### Open bugs
|
|
|
|
|
|
|
|
|
|
<https://bugzilla.gnome.org/buglist.cgi?query_format=advanced;short_desc=tag;bug_status=UNCONFIRMED;bug_status=NEW;bug_status=ASSIGNED;bug_status=REOPENED;bug_status=NEEDINFO;short_desc_type=allwordssubstr;product=GStreamer>
|
|
|
|
|
|