1

I'm trying to set up video stream via WebRTC from raspberry pi. I'm using a USB webcam, UV4L and Janus to accomplish the same. WebRTC is not working.

I've followed steps outlined here, except that I'm using uv4l instead of gstreamer. I've installed janus gateway on another (Ubuntu) machine on the same network.

My janus (on Ubuntu) when started shows this:

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

This is how I start the UV4L on pi:

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

Accessing http://PIIP:8090/stream/video.mjpeg shows the stream from home network. An interesting point to note, when uv4l is started, it does not cause any new log to show up on janus window. Is it so that my configuration is incorrect/incomplete?

Finally, when I access the link http://ip-of-server/janus-gateway-streamtest.html , clicking on Start button does nothing. Similarly, http://serverip/streamingtest.html shows a link (RPWC, as configured in janus) for streaming, but when we click on "Watch or listen", it shows nothing.

I'm sure some setting up is incorrectly done.. Which is that?

EDIT 1:

After a comment, I confirmed to check again if setting in http://piip:8090/janus is correctly set, which it was (see image below) and I clicked on Start button

enter image description here

I tried to open the http://192.168.1.101/videoroomtest.html, I'm able to see my feed, BUT - I was assuming that janus would behave more like a signalling server, in my case, it seems that janus is behaving as replay/replying server. Ideally, if the connection is established, and then if janus server goes down, then the streaming should still not break. However, I manually stopped janus, and the streaming stopped. How do I configure uv4l to use janus as signalling, and not as a relaying server (like TURN). Also, this is what I get on janus console:

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
  • 83
  • 1
  • 9
  • Hi @Jamboree, I have almost similar. I have UV4L streaming server in Rpi and Janus in a server. After I click start in the Janus server I get this: Creating new session: 2960611739243247; 0x7f2e94001320 Creating new handle in session 2960611739243247: 7487521100274189; 0x7f2e94001320 0x7f2e94001ab0 [7487521100274189] Creating ICE agent (ICE Full mode, controlled) [WARN] [7487521100274189] ICE failed for component 1 in stream 1, but let's give it some time... (trickle pending, answer received, alert not set) – Nishad Nazar Oct 27 '20 at 17:25
  • Also, In the Rpi webRTC portal - 'join the room with janus', I gave Janus server ip:port, and as given default as above photo, and click start but Im getting like this in the uv4l_raspicam.service : [server] Janus session error: Missing mandatory element (admin_key) uv4l[296]: [server] Waiting for 3 seconds before reconnecting to https://janus.conf.meetecho.com... uv4l[296]: [server] Missing mandatory element (admin_key) It will be helpful to know if u have resolved this scenario, RPi webrtc video stream to janus. – Nishad Nazar Oct 27 '20 at 17:26
  • Also, In the Rpi webRTC portal - 'join the room with janus', I gave Janus server ip:port, and as given default as above photo, and click start but Im getting like this in the uv4l_raspicam.service : uv4l[1900]: [webrtc] WebRTC Renderer extension successfully loaded uv4l[1900]: [server] WebRTC, Signalling Server and STUN Server extensions successfully loaded uv4l[1900]: [server] Janus session error: No message received uv4l[1900]: [server] Waiting for 3 seconds before reconnecting to http://20.18.83.2332:8000 – Nishad Nazar Oct 27 '20 at 17:48

1 Answers1

0

UV4L has nothing to do with gstreamer with respect to streaming to Janus. Do not mix the things.

That said, the USB camera should be automatically get recognized when you plug it in the Raspberry Pi. You do not have to run uv4l manually. From the documentation:

Since recent versions of UV4L, there should be no longer need to manually load the driver to use your webcam. After you have rebooted for the first time, it’s enough to plug in (or unplug) the webcam to have it recognized by the system service and have uv4l loaded (or unloaded) automatically. If you have installed the UV4L Streaming Server, each time you attach or detach the webcam, the corresponding server instance is also automatically created or destroyed respectively. The port the server will be listening to is specified in the configuration file (i.e. /etc/uv4l/uv4l-uvc.conf) and should be 8090 by default. You do not typically need to modify the configuration file.

After you have attached the camera, the server should start automatically. Open the Janus web page at http://rpi_address:8090/janus, fill the field gateway URL pointing to your Janus instance, and finally press Start to start to stream to the room.

smaronaus
  • 1
  • 1
  • I tried to open the http://192.168.1.101/videoroomtest.html, I'm able to see my feed, BUT - I was assuming that janus would behave more like a signalling server, in my case, it seems that janus is behaving as replay/replying server. Ideally, if the connection is established, and then if janus server goes down, then the streaming should still not break. However, I manually stopped janus, and the streaming stopped. How do I configure uv4l to use janus as signalling, and not as a relaying server (like TURN). – Jamboree Jan 30 '18 at 04:57
  • I'm of the assumption that the stream should be a P2P webrtc stream, and not pass through janus. Since everything is inside home internet (pi, server) in my setup, there shouldn't have been need of replaying via janus, however, that does seem to be the case, can you comment on that? – Jamboree Jan 30 '18 at 05:05
  • I've faced same problem. Was unable to get P2p setup done, all traffic was relayed via Janus - not exactly how P2p works – Ouroboros Jan 30 '18 at 06:30
  • Janus in a SFU, not (only) a signalling server. If it goes down, both you and the other peers "go down" too. Have a look at the signalling protocols supported by UV4L here: https://www.linux-projects.org/webrtc-signalling/ – smaronaus Feb 08 '18 at 22:30