udp - GStreamer 1.16.2 UDP 发送方和接收方“原因未协商 (-4)”错误
问题描述
我正在尝试从 RTSP 服务器接收视频源并通过多个 UDP 套接字重新发送。但首先我决定尝试一些来自互联网的例子。我找到了这个链接 ,在那里我尝试了以下管道:
SENDER:
gst-launch-1.0 videotestsrc ! jpegenc ! rtpjpegpay ! udpsink host=127.0.0.1 port=5200
RECEIVER:
gst-launch-1.0 udpsrc port=5200 ! application/x-rtp, encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! autovideosink
我在 RECEIVER 中得到以下输出:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.010658578
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
因此,错误是“未协商的原因(-4)”。我尝试了几个示例,并且经常出现此错误。从我从几个论坛中发现的内容来看,问题可能出在 RECEIVER 端的 CAPS 设置中。我尝试按照此处的建议解决它,但没有成功(大写字母是 SENDER 返回的同一个大写字母的副本):
gst-launch-1.0 udpsrc port=5200 caps = "image/jpeg, sof-marker=(int)0, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, chroma-site=(string)jpeg, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono" ! rtpjpegdepay ! jpegdec ! autovideosink
这里的错误似乎与管道构造本身有关:
WARNING: erroneous pipeline: could not link udpsrc0 to rtpjpegdepay0
我正在使用 Ubuntu 20.04.3 LTS 和 GStreamer 版本 1.16.2
1 - 我做错了什么?2 - 您是否知道“无延迟”方式来执行 RTSP 视频流的“克隆”并通过多个 UDP 链接发送它?
解决方案
推荐阅读
- logging - 如何登录 Cytoscape
- javascript - 我想在 vuejs 中确定当天的活动标签
- python - 是否有一种聪明的方法将序数编码器(基于不同的类别)应用于多个变量?
- assembly - ARM 程序集在没有 .type 宏的情况下无法工作
- python - 帧大小问题 cv2.videocapture
- python - 无法使用 Selenium 包提取属性
- python - 将年份和月份的 Stacked DataFrame 转换为具有日期时间索引的 DataFrame
- python-3.x - 从嵌套字典创建数据框
- excel - 在文件夹中搜索与 Excel 范围内不同字符串匹配的文件
- sql-server - 交叉加入事实和维度