[gst-devel] write ogg tags

René Stadler mail at renestadler.de
Tue Jan 2 21:08:06 CET 2007


Am Dienstag, den 02.01.2007, 20:22 +0100 schrieb Andreas Volz:
> Am Tue, 02 Jan 2007 19:40:15 +0100 schrieb René Stadler:
> 
> > >   gst_tag_setter_add_tags (tagsetter,
> > >                            GST_TAG_MERGE_REPLACE_ALL,
> > >                            GST_TAG_TITLE, "Geo Tagged Voice",
> > > 			   GST_TAG_ARTIST, "GPSTrigger",
> > > 			   GST_TAG_LOCATION, "GPS 123456790",
> > > 			   GST_TAG_VERSION, "0.1",
> > > 			   GST_TAG_LICENSE, "Creative Commons
> > > 				Attribution-ShareAlike 2.5", NULL);
> > 
> > Try changing GST_TAG_LOCATION to GST_TAG_EXTENDED_COMMENT and "GPS
> > 123456790" to "location=GPS 123456790" (see below).
> 
> Ok, this works.
> 
> > > result:
> > > > gst-launch-0.10 -t playbin uri=file://sound.ogg
> > > Setting pipeline to PAUSED ...
> > > Pipeline is PREROLLING ...
> > > KENNZEICHEN GEFUNDEN: Von Element »vorbisdec1« gefunden.
[...]
> > > Setting pipeline to NULL ...
> > > FREEING pipeline ...
> > > 
> > > So there's GST_TAG_LOCATION. Where is it?
> > > 
> > > BTW: I need this to tag voices with geographic information.
> > 
> > A quick peek at gst-plugins-base/gst-libs/gst/tag/gstvorbistag.c shows
> > that GST_TAG_LOCATION is not supported.  Does the vorbis spec dictate
> > how geo locations are to be stored?

I looked at the spec (the link you mentioned below), and it indeed
specifies a LOCATION field.  It does not specify in what format the
location data should be though, so my guess is that there is some
implicit convention to apply here (similar as for the DATE field).  As
Tim asked, can you file a bug against gst-plugins-base to request adding
the mapping for GST_TAG_LOCATION <-> LOCATION in gstvorbistag.c?

> I read the vorbis spec and see only that vorbis defines UTF-8 for all
> tags. I couldn't even see that date is formated in a special way. Is
> this a gstreamer enhancement?
> 
> >  Are there programs that do it?
> 
> No, not yet. But my app will do it. Isn't that enough. :-P

To quote from the document you mention below: "Individual 'vendors' may
use non-standard field names within reason. The proper use of comment
fields should be clear through context at this point. Abuse will be
discouraged." :-)

> > If not, what you try to do is a non-standard extension.  You need to
> > store your data with GST_TAG_EXTENDED_COMMENT in this case, which
> > works nicely since vorbis allows for arbitrary key=value pairs.
> 
> I think that key=value pairs are perfect for my needs. But I read
> something else in the vorbis spec:
> 
> http://xiph.org/vorbis/doc/Vorbis_I_spec.html#vorbis-spec-comment
> 
> > 5.1. Overview
> > 
> > The Vorbis text comment header is the second (of three) header packets
> > that begin a Vorbis bitstream. It is meant for short text comments,
> > not arbitrary metadata; arbitrary metadata belongs in a separate
> > logical bitstream (usually an XML stream type) that provides greater
> > structure and machine parseability.
> 
> Perhaps it's an idea to store the data as XML file. The idea isn't that
> stupid, because I'm able to get the geo data as XML structured data. Is
> this possible with gstreamer?

Sounds like overkill for storing a single coordinate pair.  I think the
spec mentions using XML bitstreams so people don't try to cram
subtitles, lyrics or textual annotations into the comment field, which
is supposed to hold meta data only.

My advice would be to decide on some good representation for the
coordinates and store them in the LOCATION field.  Use the extended
comment method until gstvorbistag.c is fixed.

> This takes me to the next question:
> 
> Is it posssible (with gstreamer) to store an image in the ogg/vorbis
> file as in MP3?

Looks like not.

> regards
> Andreas





More information about the gstreamer-devel mailing list