[gst-devel] Getting started with gnonlin
bilboed at gmail.com
Fri Jan 6 03:21:24 CET 2006
Nice to see more people using gnonlin :)
On 1/6/06, Dominique Würtz <housirer at gmx.de> wrote:
> I tried out the latest gnonlin (0.10.0.3) since I plan to use it for my
> project. I created a little Python script to to test its functionality.
> Unfortunately it wouldn't work. I think the pipeline gets stuck in the
> PREROLL state. The timeline source pad however is created.
> Here is the code:
I'll comment along the way:
> import gst
I suppose you only have gst-python >= 0.10 installed, otherwise you
should do the following before importing gst:
> import gobject
> def _timeline_new_pad_cb(self, pad):
> sink = gst.element_factory_make("alsasink")
> timeline = gst.element_factory_make("gnltimeline")
> audiocomp = gst.element_factory_make("gnlcomposition")
> gnlsource = gst.element_factory_make("gnlfilesource")
> gnlsource.set_property("location", "foo.wav")
> gnlsource.set_property("media-start", 0L)
> gnlsource.set_property("media-duration", 100000L)
1000000 is one millisecond ! You'd be better off using the
gst.SECOND (or gst.MSECOND,...).
> gnlsource.set_property("start", 0L)
> gnlsource.set_property("duration", 100000L)
> audiocomp.set_property("media-start", 0L)
> audiocomp.set_property("media-duration", 100000L)
> audiocomp.set_property("start", 0L)
> audiocomp.set_property("duration", 100000L)
For the time being, gnlcomposition have the (media)[start|duration]
automatically set to it's contents (in this case it will be set to the
duration of you gnlsource).
> timeline.set_property("media-start", 0L)
> timeline.set_property("media-duration", 100000L)
> timeline.set_property("start", 0L)
> timeline.set_property("duration", 100000L)
I'm slapping myself really hard :( The gnltimeline and gnloperation
do nothing for the time being. In fact gnltimeline is going to go away
(with the gnlobject-0.10 way of working, you can just replace it with
a bin, if you really need that).
> timeline.connect("pad-added", _timeline_new_pad_cb)
> pipeline = gst.Pipeline()
> pipeline.add(timeline, sink)
Because of the previous comment, replace all mention of gnltimeline
with your audiocomp.
> Just a side note:
> This works: gst-launch filesrc location="foo.wav" ! decodebin ! alsasink
> While this won't: gst-launch gnlfilesrc location="foo.wav" ! decodebin !
The gnlfilesource contains decodebin within (it's it's purpose, just
give a location and (if needed) a caps). Also, the default values for
(media)[start|duration] are set to 0, so it will play for... 0
> Any ideas why the pipeline won't play?
Try following all the instructions given above. Although with latest
cvs, there seems to be an issue, where the fakesink contained in
decodebin doesn't get removed. I'm having a look at it now.
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
Junior developer / Fluendo S.L.
More information about the gstreamer-devel