我正在尝试使用GStreamer将Camera图像从树莓派pi2传输到Ubuntu计算机。
通过具有easycap的USB将相机连接到树莓派。
用于流式传输相机的代码是:
#!/bin/bash
clear
gst-launch-1.0 -v v4l2src device=/dev/video0 !omxh264enc ! avimux !udpsink host=192.168.0.102 port=6030
对于Ubuntu,我正在使用以下
#!/bin/bash
clear
gst-launch-1.0 -e -v udpsrc port=6000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false
当我运行代码时,树莓派会流式传输数据,而ubuntu会接收数据,但是没有打开流式传输窗口,并且出现以下错误
WARNING: from element /GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0: Could not decode stream.
Additional debug info:
gstrtpjitterbuffer.c(3247): gst_rtp_jitter_buffer_chain (): /GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0:
Received invalid RTP payload, dropping
我愿意接受建议,谢谢
答案 0 :(得分:1)
尝试以下操作:
在发送者处,使用元素rtph264pay
gst-launch-1.0 -v v4l2src device=/dev/video0 ! omxh264enc ! rtph264pay ! udpsink host=192.168.0.102 port=6030
在接收方使用以下两个命令之一来监视UDP统计信息:
cat /proc/net/snmp | grep Udp\:
cat /proc/net/udp
此外,您还可以在管道中使用元素h264parse
:
#Sender
gst-launch-1.0 -v v4l2src device=/dev/video0 ! omxh264enc ! h264parse ! rtph264pay ! udpsink host=192.168.0.102 port=6030
#Receiver
gst-launch-1.0 -e -v udpsrc port=6030 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! h264parse ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false