[gst-devel] Problem with GnlFileSource media_start property

Raaf monraaf at gmail.com
Thu Jun 25 23:50:21 CEST 2009


I'm having trouble with the GnlFileSource media_start property, with
audio it all seems to work fine but with video I don't get it to work.
For example the code below works fine as long as the media_start
property is 0, any other value and I get erratic 'slide show' like
playback.  Is there anything I'm missing here?

---------------------------------
import sys, gobject
gobject.threads_init()
import gst

def on_pad_added(composition, pad):
    pad.link(colorspace.get_pad('sink'))

pipe = gst.Pipeline()
composition = gst.element_factory_make('gnlcomposition')
colorspace = gst.element_factory_make('ffmpegcolorspace')
timeoverlay = gst.element_factory_make('timeoverlay')
xvimagesink = gst.element_factory_make('xvimagesink')

pipe.add(composition, colorspace, timeoverlay, xvimagesink)
gst.element_link_many(colorspace, timeoverlay, xvimagesink)

gnlfilesrc = gst.element_factory_make('gnlfilesource')
gnlfilesrc.props.caps = gst.caps_from_string('video/x-raw-rgb; video/x-raw-yuv')
gnlfilesrc.props.location = sys.argv[1]
gnlfilesrc.props.start = 0 * gst.SECOND
gnlfilesrc.props.duration = 60 * gst.SECOND
gnlfilesrc.props.media_start = 0 * gst.SECOND
gnlfilesrc.props.media_duration = 60 * gst.SECOND

composition.add(gnlfilesrc)
composition.connect('pad-added', on_pad_added)

pipe.set_state(gst.STATE_PLAYING)
gobject.MainLoop().run()




More information about the gstreamer-devel mailing list