【问题标题】:Gstreamer Pipeline Dynamic Change PythonGstreamer 管道动态更改 Python
【发布时间】:2014-11-23 15:54:19
【问题描述】:

我一直在尝试动态更改 gstreamer 管道,但它只是在我更改状态后立即停止流。我在这里绞尽脑汁是为了什么。这是我的代码:

#!/usr/bin/python
import gobject
import time

gobject.threads_init()
import pygst

pygst.require("0.10")
import gst

p = gst.parse_launch("""filesrc location=/home/jango/Pictures/4.jpg name=src1 ! decodebin ! queue ! videoscale ! ffmpegcolorspace !
imagefreeze ! capsfilter name=vfps caps="video/x-raw-yuv, framerate=60/1, width=640, height=420" ! theoraenc ! oggmux name=mux ! filesink location=1.ogg""")

p.set_state(gst.STATE_PLAYING)
time.sleep(10)
print "State change"
p.set_state(gst.STATE_READY)
source = p.get_by_name("src1")
source.set_property("location", "/home/jango/Pictures/2.jpg")
p.set_state(gst.STATE_PLAYING)
gobject.MainLoop().run()

如果有任何替代方法或任何我可以参考的教程,请建议我。 提前致谢。

【问题讨论】:

    标签: python gstreamer python-gstreamer dynamic-properties


    【解决方案1】:

    使用Gstreamer-Editing-Services 可能是一种选择,它将为您处理所有管道重新布线,使用比 GStreamer 更高级别的 API。

    【讨论】:

    • 链接已损坏。你能更新新链接吗?
    • 更新了链接
    猜你喜欢
    • 2015-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-01
    • 2016-09-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多