# SOLVED: gstreamer- linking playbin2

**URL:** <https://www.ruby-forum.com/t/solved-gstreamer-linking-playbin2/216945>\
**Category:** Ruby-Gnome 2\
**Created:** [February 17, 2012, 1:05pm UTC](https://www.ruby-forum.com/t/solved-gstreamer-linking-playbin2/216945 "2012-02-17T13:05:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [February 17, 2012, 1:05pm UTC](https://www.ruby-forum.com/t/solved-gstreamer-linking-playbin2/216945/1 "2012-02-17T13:05:11Z")

</div>

hello all,

quite some time ago i posted a question about linking elements to  
gstreamer’s playbin2 - [Gstreamer: linking playbin2 - Ruby-Gnome 2 - Ruby-Forum](http://www.ruby-forum.com/topic/1329197)

after shelving it for a long time, i started fooling around with it  
again the other day and managed to figure out how to link playbin2 to  
the equalizer plugin. i thought i’d share it here as we couldn’t come  
up with any answers last time around…

the basics are like this:

@pipeline = Gst::ElementFactory.make(“playbin2”)  
audio = “test.mp3” ## MODIFY THIS  
@pipeline.uri= GLib.filename\_to\_uri(audio)

bin = Gst::Bin.new()  
@eq = Gst::ElementFactory.make(“equalizer-10bands”)  
autosink = Gst::ElementFactory.make(“autoaudiosink”)

bin.add(@eq)  
bin.add(autosink)  
@eq \>\> autosink

eqpad = @eq.get\_pad(“sink”)  
gpad = Gst::GhostPad.new(“gpad”, eqpad)  
bin.add\_pad(gpad)

@pipeline.audio\_sink = bin

@pipeline.play

then, in the gui you do a bunch of sliders like this one:

slider0 = Gtk::VScale.new(-24, 12, 1)  
slider0.inverted = true  
slider0.set\_size\_request(20,200)  
slider0.set\_value(@eq.band0)  
slider0.signal\_connect(“value-changed”){@eq.band0 =(slider0.value)}

…and it works - finally!

- j

---

<div class="post-metadata">

**Author:** ![lljk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/a9a28c/32.png) [@lljk](https://www.ruby-forum.com/u/lljk)\
**Post date:** [February 17, 2012, 10:08pm UTC](https://www.ruby-forum.com/t/solved-gstreamer-linking-playbin2/216945/2 "2012-02-17T22:08:41Z")

</div>

Le 17 fvrier 2012 13:05, jake kaiden [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
a  
crit :

> the basics are like this:  
> bin.add(autosink)  
> then, in the gui you do a bunch of sliders like this one:
> 
> ruby-gnome2-devel-en mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)

Hello Jake.

Thanks for the sample code. I found it usefull.
