Forum: Ruby-Gnome 2 gstreamer spider

Posted by J. K. (j_k)
on 2011-02-21 15:31
hello all,

  i use gstreamer for an audio player i've written, though i must
confess i don't fully understand it - and the documentation i can find
online is not always terribly helpful.
  for some reason i don't seem to have the "spider" plugin...  i'm
running ubuntu 10.4, and have installed all of the plugin packages
(base, good, bad, and ugly,) through the package manager, but
gst-inspect shows no spider plugin.
  at the moment i'm using the "mad" plugin, which only allows for mp3
playback.  when i try to use spider as a decoder, like this:

decoder = Gst::ElementFactory.make("spider", "foo")

  i get an error "...:in `add': Gst::Element expected"

  any ideas how i can install the spider plugin?

  as a side question...   anyone know of other sound libraries for ruby
that are as functional as gstreamer, but perhaps better documented?

  thanks -

  jk
Posted by Vincent Carmona (vinc-mai)
on 2011-02-21 16:09
(Received via mailing list)
2011/2/21 J. K. <ruby-forum-incoming@andreas-s.net>:
> playback. when i try to use spider as a decoder, like this:
> thanks -
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> ruby-gnome2-devel-en mailing list
> ruby-gnome2-devel-en@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ruby-...
>

Hi.

I do not see spider in the plugins list :
http://gstreamer.freedesktop.org/documentation/plugins.html .
You can use playbin2.

--
Vincent Carmona
Posted by marcin@saepia.net (Guest)
on 2011-02-21 21:34
(Received via mailing list)
AFAIR spider was used in 0.8 series, it does not exist any more. Try
decodebin, playbin or playbin2

m.
Posted by J. K. (j_k)
on 2011-02-22 00:35
marcin@saepia.net wrote in post #982983:
> AFAIR spider was used in 0.8 series, it does not exist any more. Try
> decodebin, playbin or playbin2
>
> m.

hi,
  thanks for the feedback - seems like playbin2 should be my answer, but
now this code:

######
filesrc = Gst::ElementFactory.make("filesrc")
filesrc.location = @atBatURI
decoder = Gst::ElementFactory.make("playbin2")
audiosink = Gst::ElementFactory.make("autoaudiosink")
@pipeline.add(filesrc, decoder, audiosink)
filesrc >> decoder >> audiosink
######

 with @atBatURI being something like "file:///home/folder/track.mp3",
gives me this error:

undefined method `>>' for nil:NilClass

  not sure if i'm getting nil for the filesource or the decoder...  the
'mad' decoder that i was using doesn't use URI's, and i had to change
some code earlier upstream to make the filesource a URI location - maybe
i mucked it there.  going to keep fiddling with it and see if i come up
with the answer - but if there's something obvious that i'm missing i'd
appreciate it if someone could point it out to me!

  edit...

  as i'm reading the playbin2 page more, it looks as though i have to 
set the uri property of the playbin, rather than just defining the 
filesource as a URI address - is this true, and if so any ideas how i do 
so?

  thanks again for the help -

  j
Posted by J. K. (j_k)
on 2011-02-22 01:21
hi, me again...

  so if my understanding is right, playbin2 is a pipeline in and of
itself.  i've tried modifying my code like this:

#########
@pipeline = Gst::ElementFactory.make("playbin2")
@pipeline.uri= @atBatURI
audiosink = Gst::ElementFactory.make("autoaudiosink")
@pipeline.add(audiosink)
... (truncated)
@pipeline.play
#########

this doesn't throw any errors, but also doesn't play the file!  i'm
cleary doing something wrong here...  i don't program in C, so i'm
having a bit of a hard time with the documentation - seems i need to use 
the #element_set_state function, to set the state to PLAYING, rather 
than calling @pipeline.play - but i'm not having any luck... can anyone 
set me straight here?

  thanks again....

 jk
Posted by J. K. (j_k)
on 2011-02-22 11:35
problem solved....

  it was the audiosink that was causing my latest problems.  using 
playbin2 as the pipeline, without defining any other audiosink works 
perfectly with #.play .

  thanks once more for the links and advice.

 -jk
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.