Gstreamer Mac OS X udpsink error

筅森魡賤 提交于 2019-12-04 15:17:01

问题


I’m trying to stream audio in Mac OS X but I keep getting this error:

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 …

This works in Windows replacing osxaudiosrc with autoaudiosrc, anyone know what's the problem?

thanks


回答1:


You might be missing the gst-ffmpeg plugin. I'm saying this because I'd encoutered a similiar problem.

You can install it using Homebrew (preferred) or MacPorts.

Homebrew command: brew install gst-ffmpeg

I would also suggest installing the other packages. This command will install GStreamer and all it's packages: brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-ffmpeg.

Use brew search gst to search for other packages that you might need concerning GStreamer.

Good luck!




回答2:


There is a bug in the udpsink/multiudpsink code related to IPV6 enabled systems and socket creation.

If you are coding up your pipeline in C you can bypass this by manually creating the socket to use and using that for the sink like so.

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);

If you were just going to use it using gst-launch I'm afraid that you will have to edit your way through multiudpsink.c until you figure out how to bypass thus.




回答3:


This bug has been fixed in GStreamer-1.0 so install (e.g. port install gstreamer1-gst-plugins-good) and run - making sure you use the v1 pipeline:

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


来源:https://stackoverflow.com/questions/4094990/gstreamer-mac-os-x-udpsink-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!