Gstreamer在Mac OS X中使用udpsink出现错误

3

我正在尝试在Mac OS X上流式传输音频,但我一直收到以下错误:

gst-launch osxaudiosrc ! audioresample ! audioconvert ! alawenc ! rtppcmapay ! udpsink port=10001 host=192.168.2.10

Setting pipeline to PAUSED …
ERROR: Pipeline doesn’t want to pause.
ERROR: from element /GstPipeline:pipeline0/GstUDPSink:udpsink0: Could not get/set settings from/on resource.
Additional debug info:
gstmultiudpsink.c(804): gst_multiudpsink_configure_client (): /GstPipeline:pipeline0/GstUDPSink:udpsink0:
Could not set TTL socket option (22): Invalid argument
Setting pipeline to NULL …
Freeing pipeline …

这在Windows中可以工作,将osxaudiosrc替换为autoaudiosrc,有人知道问题出在哪里吗?
谢谢。

这种情况也发生在我类似的案例中:https://dev59.com/NFPTa4cB1Zd3GeqPhkX8 你找到解决方案了吗? - Ory Band
3个回答

8
你可能缺少 gst-ffmpeg 插件。我之所以这么说是因为我遇到了一个类似的问题,可以参考 这里
你可以使用 Homebrew(首选)或者 MacPorts 来安装它。
Homebrew 命令: brew install gst-ffmpeg 我还建议安装其他包。该命令将安装 GStreamer 及其所有包: brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-ffmpeg
使用 brew search gst 来搜索与 GStreamer 相关的其他包。
祝好运!

1

udpsink/multiudpsink代码中存在一个与启用IPV6系统和套接字创建相关的错误。

如果您正在使用C编写管道,可以通过手动创建要使用的套接字并将其用于sink来绕过此问题,如下所示。

my_sink = gst_element_make_from_uri(GST_URI_SINK, "udp://233.34.28.1:31337", NULL);
int my_tx_socket;
my_tx_socket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)
g_object_set(G_OBJECT(my_sink), “sockfd”, my_tx_socket, NULL);

如果你只是想使用 gst-launch,恐怕你必须编辑 multiudpsink.c 文件,直到你找到如何绕过这个问题的方法。


0

这个 bug 已经在 GStreamer-1.0 中修复了,所以请安装(例如 port install gstreamer1-gst-plugins-good)并运行 - 确保您使用的是 v1 管道:

gst-launch-1.0 osxaudiosrc ! audioresample ! audioconvert ! alawenc ! rtppcmapay ! udpsink port=10001 host=192.168.2.10

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接