Skip to main content
 首页 » 编程设计

Python 和 Gstreamer

2025年05月04日9mengfanrong

我正在创建一个流应用程序,将 GStreamer 与 TCP 管道结合使用,并实现了启动、暂停和停止。

但问题是,我找不到,我尝试从服务器端更改播放值,然后我在客户端尝试,最后尝试同时更改两者的值,但是在所有情况下它都不起作用。我什至尝试暂停播放然后继续但没有任何反应。

我在搜索和音量方面遇到了这个问题。请提供任何帮助,我到处搜索,但找不到任何有用的东西。

这是我用来寻找的代码

self.pipeline.seek_simple(gst.FORMAT_TIME, gst.SEEK_FLAG_FLUSH, 时间)

请您参考如下方法:

如果您还没有找到它,也许这可以解决问题:

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.

这是一个例子:Seeking with GStreamer