Gstreamer 在 macOS 上流式传输和接收

Gstreamer streaming and receiving on macOS

我正在尝试让发送方和接收方应用程序在 macOS 上运行。这些是我正在使用的命令:

发送方:

./gst-launch-1.0 -v uridecodebin name=uridec uri=file:///Users/nathanapps/Documents/Vuze\ Downloads/John\ Wick\ Chapter\ 2\ 2017\ 720p\ BRRip\ 900\ MB\ -\ iExTV/John\ Wick\ Chapter\ 2\ 2017\ iExTV.Com.mp4 ! queue ! videoconvert ! x264enc ! video/x-h264 ! mpegtsmux name=mux ! queue ! udpsink host=224.3.0.11 port=5000 sync=true uridec. ! audioconvert ! voaacenc ! audio/mpeg ! queue ! mux.

接收端:

./gst-launch-1.0 -v udpsrc port=5000 ! tsparse ! decodebin name=dec ! videoconvert ! osxvideosink sync=true dec. ! queue ! audioconvert ! audioresample ! osxaudiosink sync=true

在接收端,我得到的只是一个绿色框。我知道服务器端正在工作,因为我已经用 VLC 尝试过了。任何帮助将不胜感激!

接收器的正确管道应该是这样的:

gst-launch-1.0 udpsrc uri=udp://127.0.0.1:5000 ! video/mpegts ! tsdemux name=demux ! video/x-h264 ! queue ! decodebin ! autovideosink  demux. ! audio/mpeg ! queue ! decodebin ! autoaudiosink

已在 linux 上使用下一个输入管道进行测试,它与您的发送管道完全相同(使用 gstreamer 测试源):

gst-launch-1.0 videotestsrc is-live=true ! videoconvert ! x264enc tune=zerolatency ! video/x-h264 ! mpegtsmux name=mux ! queue ! udpsink host=127.0.0.1 port=5000 sync=true audiotestsrc is-live=true ! audioconvert ! voaacenc ! audio/mpeg ! queue ! mux.

您可以将 autoaudiosink 和 autovideosink 接收器包装更改为 OS X,但我认为这不是必须的。