首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Janus网关无法从RTSP流中获取视频流,而gstreamer和VLC很容易流传输

Janus网关无法从RTSP流中获取视频流,而gstreamer和VLC很容易流传输
EN

Stack Overflow用户
提问于 2021-09-18 10:49:15
回答 1查看 235关注 0票数 0

正如标题所示,使用gStreamer或VLC,我可以使用下面的命令毫无问题地获得要显示的视频

gst-launch-1.0 rtspsrc protocols=tcp location="rtsp://{USER}:{PASSWD}@{URL}:63554/axis-media/media.amp?videocodec=h264" short-header=TRUE ! rtph264depay ! decodebin ! fpsdisplaysink

我可以在VLC中将其设置为Network Stream,如下所示,结果类似

rtsp://{USER}:{PASSWD}@{URL}:63554/axis-media/media.amp?stream=0&videocodec=h264

但是janus (最新/稳定: v0.11.3)配置如下,无法在网页上显示流

代码语言:javascript
复制
        type = "rtsp"
        id = 99
        description = "RTSP Test"
        audio = false
        video = true
        url = "rtsp://{USER}:{PASSWD}@{URL}:63554/axis-media/media.amp?stream=0&videocodec=h264"
        videortpmap = "H264/90000"
        videofmtp = "profile-level-id=42e01f;packetization-mode=1"
        videoopt=96 
        secret = "adminpwd"

错误(重复)如下所示

代码语言:javascript
复制
2021-09-18T10:20:56Z janus-gateway.janus-gateway[30166]: [rtsp-test] Reconnected to the RTSP server, streaming again
2021-09-18T10:20:56Z janus-gateway.janus-gateway[30166]: [rtsp-test] 30s passed, sending OPTIONS

而且还

代码语言:javascript
复制
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: * Connection #0 to host {IP} left intact
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: SETUP answer:RTSP/1.0 200 OK
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: CSeq: 2
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: Transport: RTP/AVP;unicast;client_port=10092-10093;server_port=50000-50001;ssrc=E60B5F25;mode="PLAY"
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: Server: GStreamer RTSP server
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: Session: c7gVPWsPKB48EAYw; timeout=60
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: Date: Sat, 18 Sep 2021 10:11:57 GMT
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: 
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]:   -- RTP port (video): 50000
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]:   -- RTCP port (video): 50001
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]:   -- SSRC (video): 3859504933
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]:   -- RTSP session timeout (video): 30000 ms
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: [WARN] No host address for the RTSP video stream, no latching will be performed
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: RTSP video latching: 0.0.0.0:50000
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]:   -- RTCP: 0.0.0.0:50001
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: Sending PLAY request...
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: * Found bundle for host {IP}: 0x7f143c01cee0 [can pipeline]
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: * Re-using existing connection! (#0) with host {IP}
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: * Connected to {IP} ({IP}) port 63554 (#0)
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: > PLAY rtsp://{USER}:{PASSWD}@{URL}:63554/axis-media/media.amp?stream=0&videocodec=h264 RTSP/1.0
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: CSeq: 3
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: Session: c7gVPWsPKB48EAYw
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: Range: npt=0.000-
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: 
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: < RTSP/1.0 200 OK
2021-09-18T10:21:02Z janus-gateway.janus-gateway[30166]: < CSeq: 3

现在,我必须使用gstreamer来捕获rtsp流,并将其作为rtp发送给janus。

gst-launch-1.0 rtspsrc protocols=tcp location="rtsp://{USER}:{PASSWD}@{URL}:63554/axis-media/media.amp?videocodec=h264" short-header=TRUE ! rtph264depay ! decodebin ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=1500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=8004

但这可能会保持24/7的流,这可能是有问题的……

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-19 07:34:08

Janus网关/服务器不支持interleaved mode。而且目前在Janus Streaming插件(基于Curl)中实现了对RTSP的支持,因此几乎不可能在那里添加这样的支持。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69233942

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档