Ubuntu 14.04 Gstreamer自动视频接收器

Ubuntu 14.04 Gstreamer自动视频接收器,ubuntu,gstreamer,pipeline,Ubuntu,Gstreamer,Pipeline,我正在尝试在Ubuntu 14.04上运行Gstreamer视频流,但接收器端无法正确显示视频。我有一个发送MJPEG图像的发送者管道,我开始这样做: gst-launch-1.0 -v videotestsrc ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5200 输出为: Setting pipeline to PAUSED ... Pipeline is PREROLLING ... /GstPipeline:pipeline

我正在尝试在Ubuntu 14.04上运行Gstreamer视频流,但接收器端无法正确显示视频。我有一个发送MJPEG图像的发送者管道,我开始这样做:

gst-launch-1.0 -v videotestsrc ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5200
输出为:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:sink: caps = video/x-raw, width=(int)320, height=(int)240, framerate=(fraction)30/1, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:src: caps = image/jpeg, sof-marker=(int)0, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstRtpJPEGPay:rtpjpegpay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, a-framerate=(string)30.000000, a-framesize=(string)320-240, payload=(int)96, ssrc=(uint)1970481773, timestamp-offset=(uint)1012832172, seqnum-offset=(uint)21614
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, a-framerate=(string)30.000000, a-framesize=(string)320-240, payload=(int)96, ssrc=(uint)1970481773, timestamp-offset=(uint)1012832172, seqnum-offset=(uint)21614
/GstPipeline:pipeline0/GstRtpJPEGPay:rtpjpegpay0.GstPad:sink: caps = image/jpeg, sof-marker=(int)0, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstRtpJPEGPay:rtpjpegpay0: timestamp = 1012832172
/GstPipeline:pipeline0/GstRtpJPEGPay:rtpjpegpay0: seqnum = 21614
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
接收管道为:

gst-launch-1.0 udpsrc port=5200 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, a-framerate=(string)30.000000, a-framesize=(string)320-240, payload=(int)96" ! rtpjpegdepay ! jpegdec ! xvimagesink
请注意,我已从发件人信息中复制了大写字母

但是,我不断收到一个“无法发送粘性事件”错误,接收器立即终止。我可能做错了什么?我的输出如下:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.016961467 12229      0x266a400 WARN                GST_PADS gstpad.c:3669:gst_pad_peer_query:<jpegdec0:src> could not send sticky events
0:00:00.017297845 12229      0x266a400 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<udpsrc0> error: Internal data flow error.
0:00:00.017306308 12229      0x266a400 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.000651039
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
正在将管道设置为暂停。。。
管道是带电的,不需要预滚。。。
正在将管道设置为播放。。。
新时钟:GstSystemClock
0:00:00.016961467 12229 0x266a400警告GST_pad gstpad.c:3669:GST_pad_peer_查询:无法发送粘性事件
0:00:00.017297845 12229 0x266a400 WARN basesrc gstbasesrc.c:2865:gst_base_src_循环:错误:内部数据流错误。
0:00:00.017306308 12229 0x266a400 WARN basesrc gstbasesrc.c:2865:gst_base_src_循环:错误:流式处理任务已暂停,原因未协商(-4)
错误:来自元素/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:内部数据流错误。
其他调试信息:
gstbasesrc.c(2865):gst_base_src_loop():/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
流式处理任务已暂停,原因未协商(-4)
执行在0:00:00.000651039后结束
正在将管道设置为暂停。。。
正在将管道设置为就绪。。。
正在将管道设置为空。。。
释放管道。。。
我尝试过autovideosink,ximagesink,结果也一样


谢谢。

好的,您只需要添加videoconvert-jpegdec生成xImage Sink无法理解的视频:

gst-launch-1.0 udpsrc port=5200 ! application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)JPEG\,\ a-framerate\=\(string\)\"30\\\,000000\"\,\ payload\=\(int\)26\,\ ssrc\=\(uint\)2512101225\,\ timestamp-offset\=\(uint\)1627080146\,\ seqnum-offset\=\(uint\)4727 ! rtpjpegdepay ! jpegdec ! videoconvert ! xvimagesink
我怎么知道的?通过这种方式使用fakesink:

udpsrc ! fakesink -v
那么,工作了吗

udpsrc ! rptjpegdepay ! fakesink 
又工作了。。所以我继续这样做,发现问题真的出在我身上。。奇怪的是,我们没有得到更明确的错误消息

您还可以使用以下工具调试应用程序:

GST_DEBUG=4 gst-launch-1.0 udpsrc .....

您可以滚动到未协商的部分并四处查看。

好的,您只需添加videoconvert-jpegdec生成xImage Sink无法理解的视频:

gst-launch-1.0 udpsrc port=5200 ! application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)JPEG\,\ a-framerate\=\(string\)\"30\\\,000000\"\,\ payload\=\(int\)26\,\ ssrc\=\(uint\)2512101225\,\ timestamp-offset\=\(uint\)1627080146\,\ seqnum-offset\=\(uint\)4727 ! rtpjpegdepay ! jpegdec ! videoconvert ! xvimagesink
我怎么知道的?通过这种方式使用fakesink:

udpsrc ! fakesink -v
那么,工作了吗

udpsrc ! rptjpegdepay ! fakesink 
又工作了。。所以我继续这样做,发现问题真的出在我身上。。奇怪的是,我们没有得到更明确的错误消息

您还可以使用以下工具调试应用程序:

GST_DEBUG=4 gst-launch-1.0 udpsrc .....

您可以滚动到未协商发生的部分并四处查看。

我几乎一直收到的棘手事件。。别理它。。真正的问题是——不是谈判。。这意味着这些元素没有完全链接在一起,因为它们彼此不理解,我将在我的机器上检查它们。我几乎一直都会收到粘性事件。。别理它。。真正的问题是——不是谈判。。这意味着元素没有完全连接在一起,因为它们彼此不理解,我会在我的电脑上查一下machine@wireless_freedom很高兴听到:)如果它解决了你的问题,你可以通过在投票下面打勾来接受这个答案number@wireless_freedom很高兴听到:)如果它解决了你的问题,你可以通过在投票号码下打勾来接受这个答案