我正在尝试使用 AppSink 接收器从中读取样本,但该对象上似乎不存在任何 AppSink 方法。import gigi.require_version("Gst", "1.0")from gi.repository import GstGst.init()pipe = Gst.parse_launch("audiotestsrc ! opusenc ! appsink name=sink")sink = pipe.get_by_name("sink")while not sink.is_eos(): pass错误Traceback (most recent call last): File "x.py", line 9, in <module> while not sink.is_eos():AttributeError: 'GstAppSink' object has no attribute 'is_eos'gstreamer 版本:gst-inspect-1.0 version 1.14.1GStreamer 1.14.1https://launchpad.net/distros/ubuntu/+source/gstreamer1.0
1 回答
慕码人2483693
TA贡献1860条经验 获得超9个赞
该appsink接口位于与基本 GStreamer 不同的库中。您还需要导入GstApp:
import gi
gi.require_version("Gst", "1.0")
gi.require_version("GstApp", "1.0")
from gi.repository import Gst, GstApp
Gst.init(None)
pipe = Gst.parse_launch("audiotestsrc ! opusenc ! appsink name=sink")
sink = pipe.get_by_name("sink")
while not sink.is_eos():
pass
添加回答
举报
0/150
提交
取消