繁体   English   中英

使用Gstreamer和easycap将摄像机视频从树莓流传输到Ubuntu计算机

[英]Stream camera video from raspberry to Ubuntu machine using Gstreamer and easycap

我正在尝试使用GStreamer将相机图像从树莓派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

我愿意接受建议,谢谢

尝试以下操作:

  1. 为简单起见,在发送方和接收方使用相同的端口号。
  2. 在发送方,使用元素rtph264pay

    gst-launch-1.0 -v v4l2src device=/dev/video0 ! omxh264enc ! rtph264pay ! udpsink host=192.168.0.102 port=6030

  3. 在接收器上使用以下任一命令来监视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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM