tagreadbin

tagreadbin — Extract metadata (tags and stream info)

Synopsis

struct              GstTagReadBin;

Description

Tagreadbin is a stand-alone element that extracts metadata (tags and other stream info such as video resolution, audio sample rate etc.) from files given an URI.

Note

This element is still considered EXPERIMENTAL. Even though we don't expect any changes, the API provided in properties, signals and bus messages may yet change in the near future.

Tagreadbin will open the file requested and automatically plug the elements required to extract the metadata. Only demuxers, parsers or specialised tag reading elements (implementing the GstTagReader interface) will be used. No decoders will be plugged, unless video thumbnailing has been requested (which is not implemented yet).


Basic usage

Tagreadbin is a GstPipeline, so it can be used like any other GStreamer pipeline. In particular, you can retrieve the GstBus to watch for tag and error messages using gst_pipeline_get_bus(). Once the uri property has been set, the element should be set to PLAYING state using gst_element_set_state(). TAG and ERROR messages will then be posted on the pipeline's GstBus soon after. If there was no error, one or more TAG messages will be posted on the bus, followed by an EOS message. Once an ERROR or EOS message has been received, the element should be shut down by setting it to NULL state with gst_element_set_state(). It can then be re-used to extract metadata from another file.


Tag messages

Tagreadbin will collect tags from various elements and try to group them. The first tag message posted on the bus should contain the 'global tags', ie. tags that are valid for all sub-streams contained in the file. At the very least, this taglist should contain information about the container format in a GST_TAG_CONTAINER_FORMAT tag (where applicable, otherwise it will contain a translated string saying 'Unknown'). If there is a GST_TAG_DURATION tag it will contain the maximum value of all the stream durations (as queried).

After the tag message with the global tags there will be one tag message for each audio/video/subtitle stream, containing the information for that particular stream. At the very least, there should be a GST_TAG_AUDIO_CODEC, GST_TAG_VIDEO_CODEC, GST_TAG_SUBITLE_CODEC, or GST_TAG_CODEC tag. There may also be a GST_TAG_DURATION tag with the stream's duration.

For audio streams, there will be "channel" and "rate" tags (of type int) in the taglist, provided that information could be extracted.

For video streams, there will be "width", "height", "pixel-aspect-ratio" and "framerate" fields (of type int, int, fraction and fraction respectively) if that information was available.

Just like playbin, this element does not expose any pads.

Since 0.10.24

Synopsis

Element Information

plugin tagreading
author Tim-Philipp Müller <tim centricular net>
class Generic/Bin/Metadata

Element Pads

Details

struct GstTagReadBin

struct GstTagReadBin {
  GstPipeline parent;
};

tagreadbin element structure (opaque)