Gstreamer通过gst-launch问题网络流媒体

时间:2013-06-26 16:37:59

标签: networking streaming gstreamer gst-launch

Gstreamer很新,但我正在尝试使用gst-launch命令实现网络流。到目前为止,我已经设法让管道与videotestsrc一起工作但是当我尝试将filesrc放在它的位置时我遇到了麻烦。以下是我试过的

  • 使用.mov / .mkv文件和流媒体

    gst-launch -ve gstrtpbin name=rtpbin filesrc location=/home/user/Gstreamer_projects
    
    /test_videos/bbb_short_1080p.mkv ! matroskademux ! h264parse ! rtph264pay ! 
    
    rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! queue ! udpsink host=192.168.1.21 port=5000 
    
    rtpbin.send_rtcp_src_0 ! udpsink host=192.168.1.21 port=5001 sync=false async=false udpsrc 
    
    port=5005 ! rtpbin.recv_rtcp_sink_0
    

终端上的输出是

    Setting pipeline to PAUSED ...

    Pipeline is live and does not need PREROLL ...

     Setting pipeline to PLAYING ...

     New clock: GstSystemClock

     /GstPipeline:pipeline0/GstRtpBin:rtpbin.GstGhostPad:send_rtcp_src_0: caps = application/x-rtcp

    /GstPipeline:pipeline0/GstRtpBin:rtpbin

    /GstRtpSession:rtpsession0.GstPad:send_rtcp_src: caps = application/x-rtcp

    /GstPipeline:pipeline0/GstUDPSink:udpsink1.GstPad:sink: caps = application/x-rtcp

    /GstPipeline:pipeline0

    /GstRtpBin:rtpbin.GstGhostPad:send_rtcp_src_0.GstProxyPad:proxypad3: caps = application/x-rtcp

    ERROR: from element /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: GStreamer encountered a general stream error.

    Additional debug info:

    matroska-demux.c(4492): gst_matroska_demux_loop (): /GstPipeline:pipeline0
    /GstMatroskaDemux:matroskademux0:

    stream stopped, reason not-linked

    Execution ended after 1096585 ns.

    Setting pipeline to PAUSED ...

    Setting pipeline to READY ...

    /GstPipeline:pipeline0/GstUDPSink:udpsink1.GstPad:sink: caps = NULL

    /GstPipeline:pipeline0/GstRtpBin:rtpbin.GstGhostPad:send_rtcp_src_0: caps = NULL

    /GstPipeline:pipeline0/GstRtpBin:rtpbin
    /GstRtpSession:rtpsession0.GstPad:send_rtcp_src: caps = NULL

     /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0.GstPad:audio_00: caps = NULL

    /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0.GstPad:video_00: caps = NULL

    Setting pipeline to NULL ...

    Freeing pipeline ...
  • 将上述文件转换为YUV,然后将其流式传输。这在2-3fps时非常缓慢。

如果有人知道如何修复管道以正确解压缩文件或提高Gstreamer中x264enc的性能,我将非常感激!

1 个答案:

答案 0 :(得分:1)

您可以尝试在h264parse元素之前添加队列元素。另外,在管道中指定matroskademux的视频src pad。