After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 141686 - [PATCH] Proposal for printf-style tag formatting element
[PATCH] Proposal for printf-style tag formatting element
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-05-02 22:58 UTC by Jeffrey Yasskin
Modified: 2005-03-25 19:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstformattags--main--0.8--patch-2.tar.bz2 (11.21 KB, application/octet-stream)
2004-05-23 22:08 UTC, Jeffrey Yasskin
Details
gst-format-tags-0.7.0.1.tar.bz2 (191.67 KB, application/octet-stream)
2004-05-23 22:09 UTC, Jeffrey Yasskin
Details

Description Jeffrey Yasskin 2004-05-02 22:58:59 UTC
Right now, the only way I know of to get the tags out of a file from the command
line is to actually decode the file with `gst-launch --tags`. I suggest that a
printf-style tag formatting element be written that could be used in a command
line like: `gst-launch filesrc="file" ! spider ! formattags
format="%{album}:%{title}" ! filesink=/dev/stdout`. This could then be easily
wrapped up in a shell script.

The element should have a sink of type application/x-gst-tags and a source of
type text/plain.

I think format specifiers like %{tagname} work well for inserting tag values
because the names are variable length and more will be added. For other
metadata, the more traditional %c style could be used, or other delimiters, ex.
%(non-tag_data)

At the very least, all tags gstreamer knows about should be supported by %{}, %%
should insert a '%', and all C '\' escapes should work. If possible, there
should be format specifiers that insert the filename and mime type (%f and %m?).
It might be nice to also support format-specific tag names, like id3's TPE4, etc.

I have a simple program that does this formatting for mp3 and vorbis files in
arch. Archive at http://bluejay.dyndns.org/archives/2003/ version
jyasskin@mail.utexas.edu--2003/mprintf--main--0.1 (sorry, it's in haskell)

We need to decide what to do when a tag doesn't exist. So far, I've just been
inserting the empty string, but it might be better to let the user decide. Also,
tags with a list of values need to have those values separated with something.
I've been using ',', but again the user should have a choice. Finally, if we
support format-specific tags, a way to disambiguate their names from gstreamer
offical tag names is needed. Perhaps "artist" would select the gst tag, while
"id3v1:artist" would take the id3v1 tag specifically. (This solution would
constrain gst tag names to never contain ':')

I hope to be able to start writing this element after the 15th, but I figure a
bug is appropriate in case I don't get around to it or someone has a better idea.
Comment 1 Jeffrey Yasskin 2004-05-02 23:13:59 UTC
Forgot about another complication for format-specific tags: Certain ID3v2 tags
contain a map of values, rather than a simple list (COMM, TXXX, WXXX). This also
needs to be handled in the format specifier.
Comment 2 Ronald Bultje 2004-05-02 23:18:50 UTC
Why? Isn't all this up to the application? Why do we need the element?
Comment 3 Jeffrey Yasskin 2004-05-02 23:51:15 UTC
This element should exist for the same reason gst-launch exists: to help with
scripting. AFAIK, there are no elements available for manipulating tags in
scripts; I think this one would make a good start.
Comment 4 Benjamin Otte (Company) 2004-05-04 16:42:21 UTC
some thoughts:

application/x-gst-tags is deprecated. It is replaced by using the actual
pipeline and stopping that one when the tags are read. Rhythmbox uses that approach.

You really want to write your own tagging tool, because gst-launch does not
support tag writing, which is the logical second step.
Comment 5 Jeffrey Yasskin 2004-05-23 21:31:51 UTC
I have a working prototype of this element in my arch repository mirrored at
"http://bluejay.dyndns.org/archives/2003/". The version is
"arch://jyasskin@mail.utexas.edu--2003/gstformattags--main--0.8". Unfortunately,
my mirror will be offline for an indefinite period starting next weekend, so
that url may not do you much good after that. I'll attach the source so you
won't stumble on the lack of an arch repo.

Read the README for a description of what the element does, how to use it, and
what I'd like to eventually add.
Comment 6 Jeffrey Yasskin 2004-05-23 22:08:29 UTC
Created attachment 27944 [details]
gstformattags--main--0.8--patch-2.tar.bz2
Comment 7 Jeffrey Yasskin 2004-05-23 22:09:36 UTC
Created attachment 27945 [details]
gst-format-tags-0.7.0.1.tar.bz2

Result of `make dist`
Comment 8 Jeffrey Yasskin 2004-05-23 22:10:38 UTC
Comment on attachment 27944 [details]
gstformattags--main--0.8--patch-2.tar.bz2

Result of `tla get ...`
Comment 9 Ronald Bultje 2005-03-25 19:55:17 UTC
I second Benjamin's original comment, gst-launch is a test toy, not a fully
featured do-it-all tool. It is seriously out-of-scope, please write a small
python tagging tool for this purpose.