RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Native WebRTC extension for UV4L now ready!

Sun Mar 22, 2015 5:59 pm

According to the news appeared at the UV4L Homepage:
Yes, it's true! The native WebRTC extension for the UV4L Streaming Server is now ready!

At the moment this extension is available for Raspberry Pi 2 only. Packages for x86 will be provided soon. The Raspberry Pi 1 will not be supported.

To know how to install the WebRTC extension please refer to the appropriate documentation section.

Once installed, to quickly try it, go to the Streaming Server page and press "Start". Support for audio is work-in-progress.
For more informations see:
http://www.linux-projects.org/modules/n ... toryid=174

JPelletier
Posts: 17
Joined: Fri Mar 13, 2015 1:34 pm

Re: Native WebRTC extension for UV4L now ready!

Sun Mar 22, 2015 7:28 pm

Thanks, this is the command to install WebRTC:
For Raspberry 2, the WebRTC extension for the Streaming Server is also available:
$ sudo apt-get install uv4l-webrtc
Source

ktemby
Posts: 11
Joined: Mon Dec 01, 2014 3:46 am

Re: Native WebRTC extension for UV4L now ready!

Sat Apr 11, 2015 7:02 am

Thank you RpiName and Jpelletier!

Posting my experience so far in the hope of help, and that others may be helped - Although I did my best to follow all the steps on the UV4L page at http://www.linux-projects.org/modules/s ... e&artid=14, I was getting "WebRTC is not supported on this architecture" type errors. I found that for some reason the installs didn't 'stick', or i just missed one of the lines. After I re-did

sudo apt-get install uv4l-webrtc

I was able to get a black box in chrome on both x86 and x64 systems, still nothing in firefox (on an x86). I tried messing around with the framerate to 5 and res to 240p - here's my most recent manual launch of the uv4l driver -

uv4l --driver raspicam --auto-video_nr --width 320 -- height 240 --encoding h264 --framerate 5

I then went through the other instructions, and found when I attempted to do the

sudo service uv4l_raspicam restart

There were "Driver raspicam not found" errors, but then messages that the the camera was found.

Using the web server page, I'm able to see the website in Chrome - my first issue was having the signaling server address be my dynamic dns - spat out socket errors in Chrome with URL. At this point I was getting confused as it seemed the URL worked in the beginning, but then stopped. I changed that to be the IP address directly xxx.xxx.xxx.xxx:port format. After that, it appears as though I'm getting a stream, with successful ICE messages showing up in Chrome's debug but its still just a small black box. I tested once more and it looks like the URL is working again. Perhaps just a caution that it seemed the IP address directly was more reliable.

Now i'm seeing things like 'peer connection successfully created', and IceCandidate added, and can even see my internal IP address in the message, then finally 'end of candidates'. Alas, no real 'data' in the video.just yet.

I have no problem seeing the output of the working Pi Camera with IP:PORT/stream as well as IP:PORT/stream/video.mjpeg in VLC.

I'll post an update if I make more progress!

Footniko
Posts: 17
Joined: Sat Mar 21, 2015 3:11 pm

Re: Native WebRTC extension for UV4L now ready!

Thu May 07, 2015 7:15 pm

Hi! Thanks for share the solution!
But is it any method to launch uv4l-webrtc in client mode to send stream to separate signaling server?

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Fri May 08, 2015 7:25 am

Footniko wrote:But is it any method to launch uv4l-webrtc in client mode to send stream to separate signaling server?
Not yet. According to the UV4L homepage, a way to push the stream to a Kurento media server is work-in-progress:

"What's Kurento?

Kurento is a WebRTC media server and a set of client APIs making simple the development of advanced video applications for WWW and smartphone platforms. Kurento features include group communications, transcoding, recording, mixing, broadcasting and routing of audiovisual flows.

Kurento also provides advanced media processing capabilities involving computer vision, video indexing, augmented reality and speech analysis. Kurento modular architecture makes simple the integration of third party media processing algorithms (i.e. speech recognition, sentiment analysis, face recognition, etc.), which can be transparently used by application developers as the rest of Kurento built-in features."

pnetherwood
Posts: 3
Joined: Sun May 10, 2015 9:55 pm

Re: Native WebRTC extension for UV4L now ready!

Sun May 10, 2015 10:01 pm

UV4L is a great solution for near real time video streaming for the Pi. I'm getting less than half a second lag on a Pi 2 over Wifi rendering on an Android tablet which is pretty good. I looked around for some time for various solutions for streaming to Android and UV4L (either MJPEG or WebRTC) is the easiest and fastest I've found. See pnetherwood.blogspot.com for how I used it.

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Sun May 10, 2015 10:40 pm

pnetherwood wrote:UV4L is a great solution for near real time video streaming for the Pi. I'm getting less than half a second lag on a Pi 2 over Wifi rendering on an Android tablet which is pretty good. I looked around for some time for various solutions for streaming to Android and UV4L (either MJPEG or WebRTC) is the easiest and fastest I've found. See pnetherwood.blogspot.com for how I used it.
Thanks for sharing your tests. The claimed latency with WebRTC (500ms?) is slightly higher than what I would expect. I am under ~200 ms (using Firefox on PC). Note that WebRTC is "adaptive". It might take up to 1 minute of continuous streaming to adapt to your available network bandwidth.

pnetherwood
Posts: 3
Joined: Sun May 10, 2015 9:55 pm

Re: Native WebRTC extension for UV4L now ready!

Mon May 11, 2015 7:20 am

I was running Chrome beta on a Nexus 10 and it was coming in at about 300ms lag although i didn't leave for over a minute so it might improve of left a little longer. I'll give that a try and compare against a PC.

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Fri Sep 18, 2015 7:43 pm

According to the most recent news, UV4L supports optional two-way audio, meaning that it is now possible to send a live audio stream from your browser (i.e. microphone) to the audio out of the Raspberry Pi (so that it can be played back through the speakers, for example). This can be done while (optionally) streaming Audio and/or Video from the Raspberry Pi to the browser. As all these things are available via WebRTC (in pure HTML5), no particular configuration or complex installation procedures are required. out of the box two-way audio can turn the Rpi into an intercom or primitive softphone, for example, with all the features of WebRTC (mandatory encryption, NAT traversal, realtime, etc...)

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Thu Oct 29, 2015 11:06 pm

IMPORTANT UPDATE
Both video and audio are bidirectional now (each direction is optional). Both remote and local cameras (official module, USB webcam, virtual devices..) can be optionally rendered onto the screen (HDMI, touchscreen).

Screenshot:
http://www.linux-projects.org/downloads ... twoway.png

Original news:
http://www.linux-projects.org/modules/n ... toryid=184

Footniko
Posts: 17
Joined: Sat Mar 21, 2015 3:11 pm

Re: Native WebRTC extension for UV4L now ready!

Fri Oct 30, 2015 8:46 am

RpiName wrote:IMPORTANT UPDATE
Both video and audio are bidirectional now (each direction is optional). Both remote and local cameras (official module, USB webcam, virtual devices..) can be optionally rendered onto the screen (HDMI, touchscreen).

Screenshot:
http://www.linux-projects.org/downloads ... twoway.png

Original news:
http://www.linux-projects.org/modules/n ... toryid=184
Great news! Thank you!

altanai
Posts: 5
Joined: Tue Jul 21, 2015 6:36 am

Re: Native WebRTC extension for UV4L now ready!

Mon Nov 30, 2015 9:27 am

Now this ,

onopen()
webrtc:153 getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
Altanai Bisht
tara181989@gmail.com
https://altanaitelecom.wordpress.com/
Book : https://www.https://www.packtpub.com/web-development/webrtc-integrators-guide

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Mon Nov 30, 2015 11:22 am

altanai wrote:onopen()
webrtc:153 getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
UV4L already support HTTPS. At the moment is disabled by default. It can be enabled in the configuration file or from command line.

http://www.linux-projects.org/modules/n ... toryid=186

from the manual:
http://www.linux-projects.org/modules/s ... e&artid=17
HTTPS options:
--use-ssl [=arg(=yes)] (=no)
enable and use SSL

--ssl-private-key-file arg
path to the private key file used for encryption.
Can be empty if no private key file is used.

--ssl-certificate-file arg
path to the certificate file (in PEM format).
If the private key and the certificate are stored in the same file,
this can be empty if the private key file is given.

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Mon Dec 21, 2015 2:42 am

echoing a recent news at http://linux-projects.org about UV4L:
[...] the video resolution with WebRTC does not reach 720p currently, but the situation is going to change soon. It will be possible to achieve an higher HD resolution at the usual 30Hz frame rate, with ~no latency and with very little CPU consumption. This improvement on the max. resolution size will have effect on any video input device supported by UV4L [...]

communigate
Posts: 2
Joined: Fri Dec 25, 2015 8:58 am

Re: Native WebRTC extension for UV4L now ready!

Fri Dec 25, 2015 1:35 pm

If you are doing WebRTC or SIP or media development our platform is free to Raspberry developers for 5 users with no questions asked. Just download it from the ftp.communigate.com

If you want more users or production use, we provide keys; again free. DM us on twitter @communigate if you want a license bigger than 5 users. We would be very keen to see what cool ideas or applications could be born out of the Raspberry PI development community for unified communications and/or the so called IoT phenomena (Internet of Things).

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Thu Jan 14, 2016 8:49 pm

For those following this thread, a news from http://linux-projects.org
it's now possible to live stream hardware-encoded H264 HD video at full 30fps from the RaspberryPi 2 to any browser(*) over the Web, with imperceptible delay and minimal CPU usage.

This is possible thanks to the WebRTC extension for UV4L. No configuration is required! No magic gstreamer sauce here! You just need a browser to see the video ...well, and speakers if you also want to get an audio stream from the Rpi ;)

Since this is WebRTC technology, experts may already know that it's always possible to build more complex scenarios on the top of UV4L! And nothing forbids us to add Full HD in the future.

A new option for the server has been introduced allowing to specify the minimum bitrate for the adaptive streaming.

(*) At the moment of writing only Firefox supports H264 decoding. Work is in progress for Chrome

arapostol
Posts: 6
Joined: Thu Mar 27, 2014 8:54 am

Re: Native WebRTC extension for UV4L now ready!

Thu Jan 28, 2016 2:46 pm

I'm trying to use the WebRTC extension with the server and access it from my android device using mobile network (4G). I can't see any video because it is popping "ICE connection fail". Trying again with WiFi (not the same the one that the server is running) from the device it is working.

I tried switching from STUN to TURN server but that doesn't work. Any ideas?

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Thu Jan 28, 2016 4:39 pm

arapostol wrote:I'm trying to use the WebRTC extension with the server and access it from my android device using mobile network (4G). I can't see any video because it is popping "ICE connection fail". Any ideas?
Are you behind NAT?

1. open and forward the http/https port (default is 8080) to the rpi - you must have already done this.
2. make sure the STUN server in UV4L is enabled (see the manual)
3. try to forward port 3478 to the Rpi too (default port for STUN)
4. make sure that TURNs are specified correctly both on server side and/or client side.

If the NAT is NOT symmetric, usually 1. and 2. steps above are enough, if not, also try 3.
If the NAT is symmetric you need to do 1. and 4. at least

arapostol
Posts: 6
Joined: Thu Mar 27, 2014 8:54 am

Re: Native WebRTC extension for UV4L now ready!

Fri Jan 29, 2016 5:51 pm

Behind NAT but not symmetric. So:

1. I have already forwarded the port that the server is running.
2. I have also activated the internal STUN server through the parameter --server-option '--webrtc-stun-server=yes'
3. Also done that (by the way how can I change the default port?)

If I'm correct I cannot change the server's default html files. After loading the ../stream/webrtc interface I'm adding at the optionial ICE servers the following [{"urls": "stun:MY-PUBLIC-IP:3478"}] but again the same error. Again, this is only happening from the 4G mobile network. Trying from other WiFi networks (not LAN) everything works fine.

Thank you.

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Fri Jan 29, 2016 7:11 pm

arapostol wrote:Behind NAT but not symmetric.

3. Also done that (by the way how can I change the default port?)
There's no way at the moment.
arapostol wrote: If I'm correct I cannot change the server's default html files. After loading the ../stream/webrtc interface I'm adding at the optionial ICE servers the following [{"urls": "stun:MY-PUBLIC-IP:3478"}]
Note that the protocol is UDP if I remember correctly.
Anyway specifying the address in the page is not necessary, as the STUN server in UV4L is already referenced by the client.
arapostol wrote:Again, this is only happening from the 4G mobile network. Trying from other WiFi networks (not LAN) everything works fine.
If you are completely sure the NAT is not symmetric, then I have no idea, I don't see why it should not work, otherwise I'd try with a TURN server (specified as the server option too) (please paste the string in case).

arapostol
Posts: 6
Joined: Thu Mar 27, 2014 8:54 am

Re: Native WebRTC extension for UV4L now ready!

Fri Jan 29, 2016 7:15 pm

I can't find any option for internal TURN server in the documentation of uv4l-server.

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Fri Jan 29, 2016 7:23 pm

arapostol wrote:I can't find any option for internal TURN server in the documentation of uv4l-server.
please read the manual:

Code: Select all

man uv4l-server
or online:
http://www.linux-projects.org/modules/s ... e&artid=17
--webrtc-ice-servers arg
array of RTCIceServer's as single JSON string, e.g. (in one line)
[{"urls": "stun:stun1.example.net"},
{"urls": "turn:turn.example.org", "username":
"user","credential": "myPassword"}]
it's easier to specify it in the config file.

arapostol
Posts: 6
Joined: Thu Mar 27, 2014 8:54 am

Re: Native WebRTC extension for UV4L now ready!

Fri Jan 29, 2016 7:28 pm

Ok, I thought you were talking for an internal server. I've tried with a few public TURN servers that I've found but didn't work.
https://gist.github.com/yetithefoot/7592580

Have you tried if it can work with a mobile 4G connection?

RpiName
Posts: 745
Joined: Sat Jul 06, 2013 3:14 am

Re: Native WebRTC extension for UV4L now ready!

Fri Jan 29, 2016 7:35 pm

arapostol wrote:Have you tried if it can work with a mobile 4G connection?
sure, 4G works in my case with the default settings.

I did not try those TURN severs specifically, but I hardly think there are valid public TURNs available...

arapostol
Posts: 6
Joined: Thu Mar 27, 2014 8:54 am

Re: Native WebRTC extension for UV4L now ready!

Fri Jan 29, 2016 10:31 pm

It looks like that the connection with the STUN server is established.
onopen()
{"iceServers":[{"urls":["stun:stun.l.google.com:19302","stun:MY-PUBLIC-IP:3478"]}]}
peer connection successfully created!
offer(), command={"command_id":"offer","options":{"force_hw_vcodec":false}}
type=offer
Object {command_id: "geticecandidate"}
onRemoteSdpSucces()
Remote stream added: blob:http%3A//MY-PUBLIC-IP%3A1337/f715fb76-2cf8-4d86-8aab-073129269acc
Object {command_id: "answer", data: "{"type":"answer","sdp":"v=0\r\no=- 422812892541759…na=rtpmap:96 rtx/90000\r\na=fmtp:96 apt=100\r\n"}"}
type=geticecandidate
IceCandidate added: {"candidate":"candidate:2940005878 2 tcp 1518280446 IP 47301 typ host tcptype passive generation 0 ufrag uJYl8sMxaXHmIBu9","sdpMid":"","sdpMLineIndex":1}
End of candidates.
type=message
same with the TURN server
onopen()
{"iceServers":[{"urls":"turn:TURN-IP/","username":"test@test.com","credential":"test"}]}
peer connection successfully created!
offer(), command={"command_id":"offer","options":{"force_hw_vcodec":false}}
type=offer
Object {command_id: "geticecandidate"}
onRemoteSdpSucces()
Remote stream added: blob:http%3A//MY-PUBLIC-IP%3A1337/c1493d0c-6e8b-452f-a089-09f50e484522
Object {command_id: "answer", data: "{"type":"answer","sdp":"v=0\r\no=- 782307457608078…na=rtpmap:96 rtx/90000\r\na=fmtp:96 apt=100\r\n"}"}
End of candidates.
type=geticecandidate
IceCandidate added: {"candidate":"candidate:2940005878 2 tcp 1518280446 IP 55362 typ host tcptype passive generation 0 ufrag kq4A0haK/BkInQfA","sdpMid":"","sdpMLineIndex":1}
type=message
Now my thought is that the mobile operator is blocking the UDP connection? I can't think of anything else causing problem ONLY with the mobile 4G. I've asked also from a friend to try (different country, different mobile operator) and he couldn't connect either. Maybe I can try somehow hole punching..?

Return to “Camera board”