Python and Gstreamer
I'm creating a streaming application, using GStreamer with TCP pipeline, and i implemented start, pause, and stop.
but the problem is, that i can't seek, i tried to change the playback value from the server side, then i tried on the client side, and Finally tried to change the value on both at the same time, but in all cases it doesn't work. and I even tried to pause the playback then continue but nothing happens.
I'm having this problem with the seek and the volume. Any help please, I searched everywhere but i couldn't fi开发者_高级运维nd anything that worked.
this is the code that i use for seeking
self.pipeline.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, time)
Perhaps this could do the trick if you didn't find it yet:
Seeking in Gstreamer is done with the seek() and seek_simple() methods. To be able to seek you will also need to tell Gstreamer what kind of seek it should do. In the following example we will use a gst.FORMAT_TIME format constant which will as you may guess do a time seek. :D We will also use the query_duration() and query_position() methods to get the file length and how long the file has currently played. Gstreamer uses nanoseconds by default so you have to adjust to that.
Here is an example: Seeking with GStreamer
Maybe you forgot to have the bus listening for seek events. Try putting this in after setting up your pipeline:
self.bus = self.pipeline.get_bus()
self.bus.add_signal_watch()
If this doesn't work then please post more code.
精彩评论