# Gstreamer: parse tag and number of track of cd

**URL:** <https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298>\
**Category:** Ruby-Gnome 2\
**Created:** [December 16, 2009, 10:43pm UTC](https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298 "2009-12-16T22:43:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [December 16, 2009, 10:43pm UTC](https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298/1 "2009-12-16T22:43:34Z")

</div>

Hi.

I want to retrieve informations from tags.  
I watch the bus attached to a pipeline for Gst::Message::TAG. I do not  
know how to parse the tag. Is there some documentations somewhere?

I want to retrieve the number of tracks and tracks length from  
/dev/cdrom file. Is there a Gst way?

Vincent

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [December 28, 2009, 1:15am UTC](https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298/2 "2009-12-28T01:15:45Z")

</div>

Hi Vincent,

I have exact the same problem! It’s really badly documented. Did you  
find a solution?

Leon

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [December 28, 2009, 3:01pm UTC](https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298/3 "2009-12-28T15:01:57Z")

</div>

Hi Leon.

I do not have found a solution using GStreamer. ☹

To parse tag, I think it should exist an parse method for  
Gst::MessageTag class. There was one in the old implementation  
([https://trac.luon.net/ruby-gstreamer0.10/browser/trunk/ruby-gstreamer0.10/sample/video-player.rb](https://trac.luon.net/ruby-gstreamer0.10/browser/trunk/ruby-gstreamer0.10/sample/video-player.rb)).  
It seems that there is a function in C (gst\_message\_parse\_tag if I  
remenber what I am be told on gstreamer irc channel).  
I have open a feature request:  
[Ruby-GNOME 2 / Feature Requests / #11 Parse Gst::Message::TAG](https://sourceforge.net/tracker/?func=detail&aid=2922270&group_id=53614&atid=470972)  
Hope that someone will have time to implement it and to explain how to  
use it.

To retrieve infos from cd, I have no idea on how to do it.

Vincent

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [December 28, 2009, 3:20pm UTC](https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298/4 "2009-12-28T15:20:57Z")

</div>

I don’t think a lot of people are working on ruby-gst. I thank the ones  
that are.  
I use ruby-taglib ([Ruby-taglib](http://www.hakubi.us/ruby-taglib/)) to read tags but  
maybe you want to take a look at rtaglib  
([http://rtaglib.rubyforge.org/](http://rtaglib.rubyforge.org/)).

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [December 28, 2009, 3:05pm UTC](https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298/5 "2009-12-28T15:05:41Z")

</div>

Hi Vincent,

Thanks! Yeah, I was missing the parse method too. I really find the ruby  
gstreamer library very bugy and incomplete ☹

I think I’ll just use exiftool then or maybe a commandline script made  
in python 🙂

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [December 28, 2009, 3:30pm UTC](https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298/6 "2009-12-28T15:30:29Z")

</div>

Oh thanks. I’ll have a go with taglib then!

---

<div class="post-metadata">

**Author:** ![coubi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@coubi](https://www.ruby-forum.com/u/coubi)\
**Post date:** [January 2, 2010, 2:40pm UTC](https://www.ruby-forum.com/t/gstreamer-parse-tag-and-number-of-track-of-cd/180298/7 "2010-01-02T14:40:45Z")

</div>

Hi Leon.

I upload a patch to the tracker to parse Gst::Message::TAG.  
[https://sourceforge.net/tracker/?func=detail&aid=2924886&group\_id=53614&atid=470971](https://sourceforge.net/tracker/?func=detail&aid=2924886&group_id=53614&atid=470971)

Not sure it is well written but it seems functional. It add a parse  
method to a Gst::Message::TAG object. A hash is returned.
