我正在尝试通过树莓派的 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)...