[gst-devel] GnlOperation help

Edward Hervey bilboed at gmail.com
Mon Feb 11 10:35:44 CET 2008


Hi,

  What version of gstreamer/gst-plugins-base/gst-plugins-ugly/gnonlin do
you have ?

  Does it output any warnings while playing (GST_DEBUG=2 python
myscript.py) ?

     Edward

On Sat, 2008-02-09 at 18:29 -0500, Mike MacHenry wrote:
> Bellow I've pasted a python script which I expect to play a mp3 I have
> for 100 seconds. I expect that it should play from 10 seconds in to
> 110 seconds. but it seems to be ignoring my media-start property. The
> second issue is that the gnloperation seems to do nothing at all. I
> want it to mute the stream from 1 second in for 20 seconds but the
> audio just plays as normal. Anyone know what I'm doing wrong?
> 
> Thanks for the help,
> -mike
> 
> import gobject
> gobject.threads_init()
> import pygst
> pygst.require("0.10")
> import gst
> 
> pipeline = gst.Pipeline()
> gnlcomposition = gst.element_factory_make("gnlcomposition")
> audioconvert = gst.element_factory_make("audioconvert")
> alsasink = gst.element_factory_make("alsasink")
> 
> filesrc = gst.element_factory_make("gnlfilesource")
> filesrc.set_property("location","/home/dskippy/17years.mp3")
> filesrc.set_property("start", 0 * gst.SECOND)
> filesrc.set_property("duration", 100 * gst.SECOND)
> filesrc.set_property("media-start", 10 * gst.SECOND)
> filesrc.set_property("media-duration", 100 * gst.SECOND)
> filesrc.set_property("priority", 2)
> gnlcomposition.add(filesrc)
> 
> op = gst.element_factory_make("gnloperation")
> op.set_property("start", 1 * gst.SECOND)
> op.set_property("duration", 20 * gst.SECOND)
> op.set_property("priority", 1)
> v = gst.element_factory_make("volume")
> v.set_property("mute", True)
> op.add(v)
> gnlcomposition.add(op)
> 
> pipeline.add(gnlcomposition, audioconvert, alsasink)
> gst.element_link_many(audioconvert, alsasink)
> def OnPad (comp, pad):
>         convpad = audioconvert.get_compatible_pad(pad, pad.get_caps())
>         pad.link(convpad)
> gnlcomposition.connect("pad-added", OnPad)
> 
> def get_message(src, message):
>         print message
> bus = pipeline.get_bus()
> bus.add_signal_watch()
> watch_id = bus.connect("message", get_message)
> 
> pipeline.set_state(gst.STATE_PLAYING)
> 
> gobject.MainLoop().run()
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list