我试图使用流式传输的Gstreamer视频和音频的RTMP服务器(Wowza),但也有一些问题。如何通过使用RTMP流的Gstreamer?
有一个关于如何正确使用rtmpsink
,即通过RTMP媒体发送到指定的服务器插件几乎没有任何文档。不仅如此,但各具特色正确的Gstreamer流水线是rtmpsink
兼容简直是当前试错运动。
我目前的Gstreamer管道是:
sudo gst-launch-1.0 -e videotestsrc ! queue ! videoconvert ! x264enc ! flvmux streamable=true ! queue ! rtmpsink location='rtmp://<ip_address>/live live=true'
运行上面我的Linux机器上的这个错误吐出:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstRTMPSink:rtmpsink0: Could not open resource for writing.
Additional debug info:
gstrtmpsink.c(246): gst_rtmp_sink_render(): /GstPipeline:pipeline0/GstRTMPSink:rtmpsink0:
Could not connect to RTMP stream "rtmp://31.24.217.8/live live=true" for writing
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2948): gst_base_src_loop(): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstQueue:queue0: Internal data flow error.
Additional debug info:
gstqueue.c(992): gst_queue_handle_sink_event(): /GstPipeline:pipeline0/GstQueue:queue0:
streaming task paused, reason error (-5)
由于缺乏对Wowza侧文档的另一个问题实际上是针-pointing正确的IP地址指向rtmpsink
在缺乏对GStreamer的侧文件,适当的RTMP认证一旁是难以捉摸的,从一些论坛上发现了一些例子不能被确认为因其他变量工作。
通过使用rtmpsink
通过RTMP进行流式传输的正确Gstreamer管道是什么,以及如何正确实施rtmpsink
以进行验证?
感谢您的答复。在启动管道'sudo gst-launch-1.0 -e videotestsrc后,我完全按照您的指示!队列! videoconvert! x264enc! flvmux streamable = true!队列! rtmpsink location ='rtmp://192.168.78.10:1935/live/myStream''的结果与前面描述的相同。不过,将其指向Wowza服务器的公共IP地址的其他观察失败,并立即出现上述错误,但使用本地IP地址“Wowza给出的”192.168.78.10“导致它在投掷之前尝试工作一分钟左右相同的错误。 – Shiri
感谢您的帮助。事实证明,防火墙阻止了1935端口的通信,因此无法通过RTMP建立连接。 – Shiri
另一个后续问题,我有一个管道'sudo gst-launch-1.0 shmsrc socket-path =/tmp/mixer1 do-timestamp = true is-live = true! '视频/ X-原料,格式= BGRA,像素纵横比= 1/1中,隔行扫描模式=逐行,帧速率= 24/1,宽度= 1024,高度= 576'! videoconvert! x264enc比特率= 1024! h264parse! flvmux name = mux streamable = true! rtmpsink位置='rtmp://192.168.78.10:1935/live/RTMPStream'报告它正在接收数据,但只播放黑屏。虽然将其更改为“udpsink”并通过VLC播放成功。你知道这个问题可能是什么吗? – Shiri