【发布时间】:2021-10-13 11:53:42
【问题描述】:
当我为 Gstreamers python API 运行 Hello World tutorial 时,我收到以下错误:
GST_DEBUG=3 python tutorial_1.py
0:00:01.787091000 98337 0x7fde78071920 ERROR gldisplay gstgldisplay_cocoa.m:171:gst_gl_display_cocoa_setup_nsapp: Custom NSApp initialization failed
0:00:01.787178000 98337 0x7fde78071920 ERROR glutils gstglutils.c:229:gst_gl_element_propagate_display_context:<sink> Could not get GL display connection
0:00:01.788032000 98337 0x7fde78071920 WARN playbin gstplaybin2.c:4757:autoplug_select_cb:<playbin0> Could not activate sink glimagesink
0:00:01.792032000 98337 0x7fde78071920 FIXME videodecoder gstvideodecoder.c:1052:gst_video_decoder_drain_out:<vp8dec0> Sub-class should implement drain()
0:00:01.859639000 98337 0x7fde78071980 FIXME videodecoder gstvideodecoder.c:1052:gst_video_decoder_drain_out:<vp8dec0> Sub-class should implement drain()
zsh: illegal hardware instruction GST_DEBUG=3 python tutorial_1.py
但是当我在终端中运行 Gstreamer 命令时,该命令的目的基本相同,窗口会正确打开,没有任何问题:
gst-launch-1.0 -v playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm
寻找解决方案或推动正确的方向来解决这个问题。
环境:
- 硬件:
- 型号名称:MacBook Pro
- 型号标识符:MacBookPro13,3
- 处理器名称:四核 Intel Core i7
- 处理器速度:2.7 GHz
- 操作系统:
- 系统版本:macOS 11.6 (20G165)
- 内核版本:Darwin 20.6.0
- GStreamer 1.18.4
- pygobject 3.42.0
- python 3.9.7
教程中的代码:
#!/usr/bin/env python3
import sys
import gi
gi.require_version('GLib', '2.0')
gi.require_version('GObject', '2.0')
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GLib
pipeline = None
bus = None
message = None
# initialize GStreamer
Gst.init(sys.argv[1:])
# build the pipeline
pipeline = Gst.parse_launch(
"playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm"
)
# start playing
pipeline.set_state(Gst.State.PLAYING)
# wait until EOS or error
bus = pipeline.get_bus()
msg = bus.timed_pop_filtered(
Gst.CLOCK_TIME_NONE,
Gst.MessageType.ERROR | Gst.MessageType.EOS
)
# free resources
pipeline.set_state(Gst.State.NULL)
【问题讨论】:
标签: macos gstreamer gstreamer-1.0 python-gstreamer