【问题标题】:Gstreamer - stream h264 video from Logitech c920 over tcpGstreamer - 通过 tcp 从 Logitech c920 流式传输 h264 视频
【发布时间】:2015-04-15 16:19:53
【问题描述】:

我正在尝试从直接输出 h264 的 Logitech c920 流式传输视频。发送端是 Raspberry Pi,接收端是 Windows 7 PC。使用 udp 可以在 Gstreamer 中完美运行:

发件人:

gst-launch-1.0 -v v4l2src device=/dev/video0 ! \
video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! rtph264pay \
pt=127 config-interval=4 ! udpsink host=$myip port=$myport

接收者:

gst-launch-1.0 -e -v udpsrc port=5001 ! ^
application/x-rtp, payload=96 ! ^
rtpjitterbuffer ! ^
rtph264depay ! ^
avdec_h264 ! ^
autovideosink sync=false text-overlay=false

但是使用 tcp 这不起作用:

发件人

gst-launch-1.0 -v v4l2src device=/dev/video0 ! \
video/x-h264,width=960,height=720,framerate=5/1 ! h264parse ! rtph264pay pt=96 config-interval=1 \
! gdppay  ! tcpserversink host=$myip port=$myport

接收者:

gst-launch-1.0 -e -v tcpclientsrc host="172.17.166.255" port=5001  ! ^
application/x-gdp ! gdpdepay ! rtpjitterbuffer !  ^
rtph264depay ! ^
avdec_h264 ! ^
autovideosink sync=false text-overlay=false

我在接收方收到以下错误:

ERROR: from element /GstPipeline:pipeline0/GstGDPDepay:gdpdepay0: Could not decode stream.
Additional debug info:
gstgdpdepay.c(443): gst_gdp_depay_chain ():     
/GstPipeline:pipeline0/GstGDPDepay:gdpdepay0:
could not create event from GDP packet
EOS on shutdown enabled -- waiting for EOS after Error

有趣的是:如果我在启动发送方之前立即启动接收方,我会在视频流中断之前获得几秒钟的视频流。我怀疑这可能是 gdppay gdpdepay 的问题,但我不确定。

【问题讨论】:

    标签: tcp raspberry-pi gstreamer h.264


    【解决方案1】:

    以下适用于通过 TCP 流式传输 h264:

    发件人:

    v4l2src device=/dev/video0 ! video/x-h264,width=320,height=90,framerate=10/1 !
    tcpserversink host=192.168.0.4 port=5000
    

    接收者:

    tcpclientsrc  host=192.168.0.4 port=5000 !
    h264parse   ! avdec_h264  ! 
    autovideosink sync=true
    

    显然 h264 可以在不使用 gdppay/depay 的情况下通过 tcp 流式传输

    【讨论】:

      猜你喜欢
      • 2019-01-26
      • 1970-01-01
      • 1970-01-01
      • 2012-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多