[gst-devel] GnlOperation help

Mike MacHenry dskippy at ccs.neu.edu
Sun Feb 10 00:29:27 CET 2008


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()




More information about the gstreamer-devel mailing list