简体   繁体   English

Ubuntu 14.04 Gstreamer自动视频接收器

[英]Ubuntu 14.04 Gstreamer autovideosink

I am trying to get a Gstreamer video stream running on Ubuntu 14.04 but the receiver side is unable to display video properly. 我正在尝试在Ubuntu 14.04上运行Gstreamer视频流,但接收器端无法正确显示视频。 I have a sender pipeline sending MJPEG images which I start like this: 我有一个发送方管道,它发送的MJPEG图像如下所示:

gst-launch-1.0 -v videotestsrc ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5200

The output is: 输出为:

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

The receive pipeline is: 接收管道为:

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

Notice I have copied the caps from the sender info. 注意,我已经复制了发件人信息中的上限。

However, I keep getting a "could not send sticky events" error, and the receiver terminates immediately. 但是,我不断收到“无法发送粘性事件”错误,并且接收器立即终止。 What could I be doing wrong? 我可能做错了什么? My output is below: 我的输出如下:

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 ...

I have tried the autovideosink, ximagesink, with the same results. 我已经尝试过使用autovideosink,ximagesink和相同的结果。

Thanks. 谢谢。

Okey you just need to add videoconvert - the jpegdec generates video which xvimagesink does not understand: Okey,您只需要添加videoconvert-jpegdec生成xvimagesink无法理解的视频:

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

How I figured this out? 我怎么知道的? by using fakesink this way: 通过这种方式使用fakesink:

udpsrc ! fakesink -v

worked,then 工作了,然后

udpsrc ! rptjpegdepay ! fakesink 

worked again .. so I continued like this and find out that the problem is really in xvimagesink.. Its weird that we do not get more explicit error message.. 再次工作..所以我继续这样,发现问题确实出在xvimagesink ..很奇怪,我们没有得到更明确的错误消息。

Also you can debug the app with: 您还可以使用以下方法调试应用程序:

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

You can scroll to the part where not negotiated happened and look around. 您可以滚动到未协商发生的部分并环顾四周。

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

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