【问题标题】:Cannot get WebRTC to work with UV4L and janus无法让 WebRTC 与 UV4L 和 janus 一起使用
【发布时间】:2018-07-08 15:25:31
【问题描述】:

我正在尝试通过树莓派的 WebRTC 设置视频流。我正在使用 USB 网络摄像头、UV4L 和 Janus 来完成相同的任务。 WebRTC 不工作。

我已按照here 概述的步骤进行操作,但我使用的是 uv4l 而不是 gstreamer。我已经在同一网络上的另一台 (Ubuntu) 机器上安装了 janus 网关。

我的 janus(在 Ubuntu 上)启动时显示如下:

$ /opt/janus/bin/janus -F /opt/janus/etc/janus
Janus commit: 1e06290078268279ca69d5aaf0a76831973b3457
Compiled on:  Tue Jan 30 00:53:34 IST 2018

---------------------------------------------------
  Starting Meetecho Janus (WebRTC Gateway) v0.3.0
---------------------------------------------------

Checking command line arguments...
Debug/log level is 4
Debug/log timestamps are disabled
Debug/log colors are enabled
Adding 'vmnet' to the ICE ignore list...
Using 192.168.1.101 as local IP...
[WARN] Token based authentication disabled
Initializing recorder code
Initializing ICE stuff (Full mode, ICE-TCP candidates disabled, IPv6 support disabled)
STUN server to use: stun.l.google.com:19302
ICE handles watchdog started
  >> 74.125.200.127:19302 (IPv4)
Testing STUN server: message is of 20 bytes
  >> Our public address is 49.35.222.150
Crypto: OpenSSL pre-1.1.0
Fingerprint of our certificate: D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
[WARN] Data Channels support not compiled
Event handler plugins folder: /opt/janus/lib/janus/events
[FATAL] [janus.c:main:3687]     Couldn't access event handler plugins folder...
Plugins folder: /opt/janus/lib/janus/plugins
Loading plugin 'libjanus_streaming.so'...
Sessions watchdog started
JANUS Streaming plugin initialized!
Loading plugin 'libjanus_recordplay.so'...
Streaming watchdog started
JANUS Record&Play plugin initialized!
Loading plugin 'libjanus_sip.so'...
Record&Play watchdog started
JANUS SIP plugin initialized!
Loading plugin 'libjanus_videoroom.so'...
SIP watchdog started
JANUS VideoRoom plugin initialized!
Loading plugin 'libjanus_textroom.so'...
VideoRoom watchdog started
JANUS TextRoom plugin initialized!
Loading plugin 'libjanus_voicemail.so'...
TextRoom watchdog started
JANUS VoiceMail plugin initialized!
Loading plugin 'libjanus_audiobridge.so'...
VoiceMail watchdog started
JANUS AudioBridge plugin initialized!
Loading plugin 'libjanus_videocall.so'...
AudioBridge watchdog started
JANUS VideoCall plugin initialized!
Loading plugin 'libjanus_nosip.so'...
VideoCall watchdog started
JANUS NoSIP plugin initialized!
Loading plugin 'libjanus_echotest.so'...
NoSIP watchdog started
JANUS EchoTest plugin initialized!
Transport plugins folder: /opt/janus/lib/janus/transports
Loading transport plugin 'libjanus_pfunix.so'...
EchoTest watchdog started
[WARN] Unix Sockets server disabled (Janus API)
[WARN] Unix Sockets server disabled (Admin API)
[WARN] No Unix Sockets server started, giving up...
[WARN] The 'janus.transport.pfunix' plugin could not be initialized
Loading transport plugin 'libjanus_http.so'...
HTTP webserver started (port 8088, /janus path listener)...
[WARN] HTTPS webserver disabled
[WARN] Admin/monitor HTTP webserver disabled
[WARN] Admin/monitor HTTPS webserver disabled
JANUS REST (HTTP/HTTPS) transport plugin initialized!
HTTP/Janus sessions watchdog started

这就是我在 pi 上启动 UV4L 的方式:

pi@raspberrypi:~ $ uv4l --driver uvc --device-id 046d:082b --server-option '--max-streams=25' --server-option '--max-threads=29' --server-option '--port=8090' --server-option '--janus-gateway-url=http://192.168.1.101:8088'
<notice> [core] Trying to loading driver 'uvc' from built-in drivers...
<notice> [core] Loading driver 'uvc' from external plug-in's...
<notice> [driver] Video functionality 'Webcam C170' recognized at 046d:082b
<notice> [core] Device detected!
<notice> [core] Registering device node /dev/uv4l
pi@raspberrypi:~ $

访问http://PIIP:8090/stream/video.mjpeg 显示来自家庭网络的流。值得注意的一点是,当 uv4l 启动时,它不会导致任何新日志显示在 janus 窗口上。是不是我的配置不正确/不完整?

最后,当我访问链接 http://ip-of-server/janus-gateway-streamtest.html 时,单击“开始”按钮什么也没做。同样,http://serverip/streamingtest.html 显示了一个用于流式传输的链接(RPWC,在 janus 中配置),但是当我们点击“观看或收听”时,它什么也没有显示。

我确定某些设置不正确。那是什么?

编辑 1:

发表评论后,我确认再次检查http://piip:8090/janus 中的设置是否正确设置(见下图),然后我点击了开始按钮

我试图打开http://192.168.1.101/videoroomtest.html,我可以看到我的提要,但是 - 我假设 janus 的行为更像是一个信令服务器,在我的情况下,似乎 janus 的行为类似于重播/回复服务器。理想情况下,如果建立了连接,然后如果 janus 服务器出现故障,那么流式传输仍然不会中断。但是,我手动停止了 janus,并且流停止了。如何将 uv4l 配置为使用 janus 作为信令,而不是作为中继服务器(如 TURN)。另外,这是我在 janus 控制台上得到的:

Creating new session: 4606856182184138
Creating new handle in session 4606856182184138: 2281485457416758
Creating new handle in session 4606856182184138: 6811320978768068
[6811320978768068] Creating ICE agent (ICE Full mode, controlling)
[6811320978768068] The DTLS handshake has been completed
WebRTC media is now available
[WARN] [6811320978768068] Not video and not audio? dropping (SSRC 1029175205)...

【问题讨论】:

  • 嗨@Jamboree,我几乎有类似的。我在 Rpi 中有 UV4L 流媒体服务器,在服务器中有 Janus。在 Janus 服务器中单击开始后,我得到:创建新会话:2960611739243247; 0x7f2e94001320 在会话 2960611739243247 中创建新句柄:7487521100274189; 0x7f2e94001320 0x7f2e94001ab0 [7487521100274189] 创建 ICE 代理(ICE 完整模式,受控)[警告] [7487521100274189] 流 1 中的组件 1 的 ICE 失败,但让我们给它一些时间......(待处理的涓涓,收到答复,未设置警报)
  • 另外,在 Rpi webRTC 门户中 - '用 janus 加入房间',我给了 Janus 服务器 ip:port,并按照上图给出的默认值,然后单击开始,但我在uv4l_raspicam.service : [server] Janus 会话错误:缺少强制元素 (admin_key) uv4l[296]: [server] 等待 3 秒后再重新连接到 janus.conf.meetecho.com... uv4l[296]: [服务器] 缺少强制元素 (admin_key) 知道你是否解决了这种情况会很有帮助,RPi webrtc 视频流到 janus。
  • 另外,在 Rpi webRTC 门户中 - '用 janus 加入房间',我给了 Janus 服务器 ip:port,并按照上图给出的默认值,然后单击开始,但我在uv4l_raspicam.service : uv4l[1900]: [webrtc] WebRTC Renderer extension 成功加载 uv4l[1900]: [server] WebRTC、Signaling Server 和 STUN Server 扩展成功加载 uv4l[1900]: [ server] Janus session error: No message received uv4l[1900]: [server] Waiting for 3 seconds before reconnecting to 20.18.83.2332:8000

标签: video-streaming janus janus-gateway uv4l


【解决方案1】:

UV4Lgstreamer 无关,对于流式传输到 Janus。不要混在一起。

也就是说,当您将 USB 摄像头插入 Raspberry Pi 时,它应该会被自动识别。您不必手动运行uv4l。来自documentation

由于最近版本的 UV4L,应该不再需要 手动加载驱动程序以使用您的网络摄像头。重新启动后 第一次,插入(或拔出)网络摄像头就足够了 让它被系统服务识别并加载 uv4l(或 卸载)自动。如果您已安装 UV4L Streaming 服务器,每次连接或分离网络摄像头时,对应的 服务器实例也会自动创建或销毁 分别。指定服务器将要监听的端口 在配置文件(即/etc/uv4l/uv4l-uvc.conf)中,应该是 默认为 8090。您通常不需要修改配置 文件。

连接摄像头后,服务器应该会自动启动。在 http://rpi_address:8090/janus 打开 Janus 网页,填写指向您的 Janus 实例的 gateway URL 字段,最后按 Start 开始流式传输到房间。

【讨论】:

  • 我试图打开192.168.1.101/videoroomtest.html,我可以看到我的提要,但是 - 我假设 janus 的行为更像是一个信令服务器,就我而言,似乎 janus 是充当重播/回复服务器。理想情况下,如果建立了连接,然后如果 janus 服务器出现故障,那么流式传输仍然不会中断。但是,我手动停止了 janus,并且流停止了。如何将 uv4l 配置为使用 janus 作为信令,而不是作为中继服务器(如 TURN)。
  • 我假设流应该是 P2P webrtc 流,而不是通过 janus。由于在我的设置中所有内容都在家庭互联网(pi、服务器)中,因此不需要通过 janus 重播,但是,情况似乎确实如此,您能对此发表评论吗?
  • 我也遇到过同样的问题。无法完成 P2p 设置,所有流量都通过 Janus 中继 - 不完全是 P2p 的工作原理
  • SFU 中的 Janus,而不是(仅)信令服务器。如果它下降,您和其他同伴也会“下降”。在此处查看 UV4L 支持的信令协议:linux-projects.org/webrtc-signalling
猜你喜欢
  • 2018-03-06
  • 2017-02-01
  • 1970-01-01
  • 1970-01-01
  • 2021-08-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-10-31
相关资源
最近更新 更多