1

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

我已按照此处列出的步骤进行操作,但我使用的是 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)...
4

1 回答 1

0

UV4Lgstreamer与流式传输无关Janus。不要混合这些东西。

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

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

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

于 2018-01-29T21:20:57.407 回答