无法使WebRTC与UV4L和janus一起使用

时间:2018-01-29 20:41:37

标签: video-streaming janus janus-gateway uv4l

我试图通过来自raspberry pi的WebRTC设置视频流。我使用USB网络摄像头,UV4L和Janus来完成同样的工作。 WebRTC无效。

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

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

let title = "Erro ao verificar usuário no servidor"
let message = "Não foi possível atualizar os dados. Tente novamente mais tarde"
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
let ok = UIAlertAction(title: "Ok", style: .default, handler: nil)
alert.addAction(ok)
present(alert, animated: true, completion: nil)

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

$ /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

访问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中的设置是否设置正确(见下图)我点击了开始按钮

enter image description here

我尝试打开http://192.168.1.101/videoroomtest.html,我能够看到我的Feed,但是 - 我假设janus的行为更像信号服务器,在我的情况下,似乎janus表现得很好作为重播/回复服务器。理想情况下,如果建立连接,然后如果janus服务器关闭,那么流式传输仍然不会中断。但是,我手动停止janus,流媒体停止了。如何配置uv4l以将janus用作信令,而不是作为中继服务器(如TURN)。此外,这是我在janus控制台上得到的:

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:~ $

1 个答案:

答案 0 :(得分:0)

UV4L与流向gstreamer的{​​{1}}无关。不要混合东西。

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

  

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

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