2017-10-08 217 views
0

我想从Raspberry Pi Zero W流视频数据到运行Windows 10的PC。我用这个视频作为我的来源:https://www.youtube.com/watch?v=lNvYanDLHZA,这是我使用的代码(使用我的电脑的实际IP地址,而不是10.30.0.0我假装在这里):Gstreamer错误:管道不能构造:语法错误

树莓派bash脚本:

#!/bin/bash 
clear 
raspivid -n -t 0 -rot 270 -w 960 -h 720 -fps 30 -b 6000000 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=10.30.0.0 port=5000 

Windows批处理脚本:

cd C:\gstreamer\1.0\x86_64\bin 
gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false 

但是,运行后,我的批处理脚本崩溃。我得到的错误是对“gst-launch-1.0 -e -v udpsrc port=5000”的一部分,它是:

ERROR: Pipeline could not be constructed: syntax error

任何想法,我能做些什么来纠正呢?谢谢

+0

我在Ubuntu上测试了你的接收端脚本,它在我的系统上工作正常。你的安装完成了吗? –

+0

是的。我卸载了它并在计算机上重新安装了两次。 – FlyerKitten

回答

0

我认为你需要在接收器管道上做一些小的改动,除非它也在接收器中工作。

我还没有测试覆盆子pi的来源,但我认为理所当然,你的来源管道是正确的。主要的问题是,它是绝对必要把udpsrc插件的源垫,使用属性:

你的管道应该是这样的:

gst-launch-1.0 -v udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! videoconvert ! fpsdisplaysink sync=false text-overlay=false

也考虑将videoconvert插件后avdec_h264如果管道不工作。如果你不知道哪个插件是必要的,你总是可以使用decodebin这非常有用。

你总是可以做一个闭环测试的目的是这样的:

TX(这是相当相似的源):

gst-launch-1.0 -e -v videotestsrc is-live=true ! x264enc bitrate=1000 tune=zerolatency ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=10.30.0.0 port=5000 

RX:

gst-launch-1.0 -v udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink 
+0

如果我尝试对RX进行底部修复,则会出现此错误: 错误:管道不想暂停。 错误:来自元素/ GstPipeline:pipeline0/GstUDPSrc:udpsrc0:无法从/在资源上获取/设置设置。 其他调试信息: gstudpsrc。c(1561):gst_udpsrc_open():/ GstPipeline:pipeline0/GstUDPSrc:udpsrc0: 绑定失败:错误绑定到地址:试图以禁止其访问权限的方式访问套接字。 将管道设置为NULL ... 释放管道... – FlyerKitten

+0

Windows无法访问您的端口。这与这个问题无关。请继续之前修复它。 – jgorosdev

+0

好的。我在Windows中使用命令提示符的经验很少。如何修复我的端口以使其可达? – FlyerKitten

0

我找到了答案。我去了我的Windows命令提示符并键入 netstat-an |找到“UDP”|更多

这提出了繁忙的UDP端口列表,我发现端口5000是其中之一。所以我使用了不同的端口,而我的视频流通过了!