You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac下GStreamer播放HTTPS链接遇TLS/SSL支持缺失及符号错误问题

解决GStreamer播放HTTPS视频时的TLS/SSL模块加载问题

问题背景

首次使用GStreamer,尝试播放远程HTTPS视频,执行命令:

gst-launch-1.0 playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm

首次错误提示

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'source': gst.soup.session=context, session=(GstSoupSession)NULL;
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source: 安全连接建立失败。
Additional debug info:
../ext/soup/gstsouphttpsrc.c(1632): gst_soup_http_src_parse_status (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
TLS/SSL support not available; install glib-networking (6), URL: https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm, Redirect to: (NULL)
ERROR: pipeline doesn't want to preroll.
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source: 内部数据流错误。
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstTypeFindElement:typefindelement0: 流数据不足。
Additional debug info:
../plugins/elements/gsttypefindelement.c(1014): gst_type_find_element_chain_do_typefinding (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstTypeFindElement:typefindelement0:
Can't typefind stream
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

已尝试的操作

  • 通过Homebrew确认glib-networking已安装
  • 设置环境变量:
export GIO_MODULE_DIR=/opt/homebrew/Cellar/glib-networking/2.74.0/lib/gio/modules/
  • 该目录下的文件:
ls -l /opt/homebrew/Cellar/glib-networking/2.74.0/lib/gio/modules/ 
total 464
-r--r--r--  abc  admin   54848 Oct  2 00:37 libgioenvironmentproxy.so
-r--r--r--  abc  admin  179136 Oct  2 00:37 libgiognutls.so

二次错误提示

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
dlopen(/opt/homebrew/Cellar/glib-networking/2.74.0/lib/gio/modules/libgiognutls.so, 0x0001): Symbol not found: (_g_byte_array_steal)
Referenced from: '/opt/homebrew/Cellar/glib-networking/2.74.0/lib/gio/modules/libgiognutls.so'
Expected in: '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libglib-2.0.0.dylib'
Failed to load module: /opt/homebrew/Cellar/glib-networking/2.74.0/lib/gio/modules/libgiognutls.so
dlopen(/opt/homebrew/Cellar/glib-networking/2.74.0/lib/gio/modules/libgioenvironmentproxy.so, 0x0001): Symbol not found: (_g_uri_is_valid)
Referenced from: '/opt/homebrew/Cellar/glib-networking/2.74.0/lib/gio/modules/libgioenvironmentproxy.so'
Expected in: '/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libglib-2.0.0.dylib'
Failed to load module: /opt/homebrew/Cellar/glib-networking/2.74.0/lib/gio/modules/libgioenvironmentproxy.so
Got context from element 'source': gst.soup.session=context, session=(GstSoupSession)NULL;
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source: 安全连接建立失败。
Additional debug info:
../ext/soup/gstsouphttpsrc.c(1632): gst_soup_http_src_parse_status (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
TLS/SSL support not available; install glib-networking (6), URL: https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm, Redirect to: (NULL)
ERROR: pipeline doesn't want to preroll.
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source: 内部数据流错误。
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstTypeFindElement:typefindelement0: 流数据不足。
Additional debug info:
../plugins/elements/gsttypefindelement.c(1014): gst_type_find_element_chain_do_typefinding (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstTypeFindElement:typefindelement0:
Can't typefind stream
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

解决方案

1. 版本不匹配问题分析

错误提示的Symbol not found说明:Homebrew安装的glib-networking(2.74.0版本)依赖的glib符号,与GStreamer官方框架自带的glib版本不兼容。两者依赖库版本不一致,导致动态链接时符号缺失。

2. 具体解决方法

方法一:统一使用Homebrew安装GStreamer

卸载官方框架,改用Homebrew安装完整的GStreamer套件,自动处理依赖关联:

# 卸载官方GStreamer框架
sudo rm -rf /Library/Frameworks/GStreamer.framework
# 安装Homebrew版GStreamer及全量插件
brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav

安装完成后,无需手动设置GIO_MODULE_DIR,直接执行原播放命令即可。

方法二:匹配glib版本(保留官方框架)

如果需要保留官方GStreamer框架,需安装与自带glib版本匹配的glib-networking:

  1. 查看GStreamer自带glib的版本:
otool -L /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libglib-2.0.0.dylib | grep glib
  1. 根据输出的版本号,安装对应版本的glib-networking:
brew install glib-networking@<对应版本号>
  1. 更新GIO_MODULE_DIR到对应版本的目录,再重新执行播放命令。

方法三:临时改用HTTP链接

若仅用于测试,可切换到目标资源的HTTP版本(如果存在):

gst-launch-1.0 playbin uri=http://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm

内容的提问来源于stack exchange,提问作者Shashank Sachan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 23:40:31