metadatademux

metadatademux — element that parse or demux metadata from image files

Synopsis




                    GstMetadataDemux;

Properties


  "parse-only"               gboolean              : Read / Write

Description

This element parses image files JPEG and PNG, to find metadata chunks (EXIF, IPTC, XMP) in it, and then send individual tags as a 'tag message' do the application and as 'tag event' to the next element in pipeline. It also strips out the metadata chunks from original stream (unless the 'parse-only' property is set to 'true'). In addition the whole metadata chunk (striped or not) it also sent as a message to the application bus, so the application can have more controls about the metadata.

Example launch line

gst-launch -v -m filesrc location=./test.jpeg ! metadatademux ! fakesink
silent=TRUE

GST_DEBUG:*metadata:5 gst-launch filesrc location=./test.jpeg ! 
metadatademux ! fakesink

Application sample code using 'libexif' to have more control

val = gst_tag_list_get_value_index (taglist, GST_TAG_EXIF, 0);
if (val) {
 exif_chunk = gst_value_get_buffer (val);
 if (exif_chunk) {
   ed = exif_data_new_from_data (GST_BUFFER_DATA (exif_chunk),
       GST_BUFFER_SIZE (exif_chunk));
 }
}

This same idea can be used to handle IPTC and XMP directly by using libdata and exempi (or any other libraries). Notice: the whole metadata chunk sent as a message to the application contains only metadata data, i.e. the wrapper specific to the file format (JPEG, PNG, ...) is already striped out.

Element Information

plugin metadata
author Edgard Lima <edgard.lima@indt.org.br>
class Demuxer/Extracter/Metadata

Element Pads

name sink
direction sink
presence always
details image/jpeg, tags-extracted=(boolean)false; image/png, tags-extracted=(boolean)false
name src
direction source
presence always
details image/jpeg, tags-extracted=(boolean)true; image/png, tags-extracted=(boolean)true

Details

GstMetadataDemux

typedef struct {
  GstBaseMetadata metadata;
} GstMetadataDemux;

The opaque GstMetadataDemux data structure.

Property Details

The "parse-only" property

  "parse-only"               gboolean              : Read / Write

If TRUE, don't strip out any chunk.

Default value: FALSE

See Also

metadatamux