[gst-devel] Playback Rate

Ryan Ayers rayers.public at dividia.net
Tue Jul 10 16:37:18 CEST 2007


I am developing a streaming server that will stream avi files onto the network as MJPEG streams.  I am using the python bindings.  I am trying to change the playback rate using the event_new_seek function, but I am unable to make this work.  I can make it work using the decodebin or playbin however.  Here is the following code I am working on:

self._pipeline = gst.parse_launch("filesrc location=/home/test/test.avi ! avidemux ! queue ! ffdec_msmpeg4v2 ! jpegenc ! multipartmux ! multifdsink name=multifd")
event = gst.event_new_seek(2.0, gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_ACCURATE, gst.SEEK_TYPE_NONE, 0, gst.SEEK_TYPE_NONE, 0)
if not self._pipeline.send_event(event):
    print 'always fails here'
state = self._pipeline.set_state(gst.STATE_PLAYING)
if state == gst.STATE_CHANGE_FAILURE:
    print 'do not get here, since we succeed'

However, when I connect to the stream, I get normal 1.0 playback speed.  Of course, this sounds right since the send_event failed.  Additionally, I have tried the above code by sending the event to the avidemux element and the send_event succeeds, but the stream still plays back at 1.0 speed.

Do you have any suggestions on how to achieve variable speed playback using the python bindings?

Ryan




More information about the gstreamer-devel mailing list