Page 1 of 1

Streaming to a RPi using UV4L

Posted: Mon Jan 02, 2017 12:24 pm
by robyf
Hello,

I'm looking for a solution for streaming video (and possibly audio) on a meeting room big screen/projector. UV4L looked like an interesting one, especially since it supports WebRTC so it wouldn't need any special software on the laptops used for projecting.

I had in the past setup streaming of a camera connected to a RPi using UV4L without any problem but now I cannot get the viceversa to work. The browser can connect via WebRTC to the RPi but nothing appears on the RPi connected screen. I tried with both X server running and X shutdown, I tried explicitly adding the server option --webrtc-receive-video=yes, I tried with both --webrtc-renderer-fullscreen=yes and =no but no luck.

I'm myself a debian linux expert and I've a good experience with RPis but a very limited one with UV4L, so I would need support on this. First of all on how to get UV4L to actually log things (I have added --verbosity 7 to the startup command also but didn't see anything) and then, if something like that exists, pointer to documentation about streaming to a RPi (so far I found only documentation about the viceversa and just a demo about streaming and controlling remotely a RPi).

Thanks in advance!

Re: Streaming to a RPi using UV4L

Posted: Mon Jan 02, 2017 3:36 pm
by RpiName
robyf wrote:I had in the past setup streaming of a camera connected to a RPi using UV4L without any problem but now I cannot get the viceversa to work. The browser can connect via WebRTC to the RPi but nothing appears on the RPi connected screen. I tried with both X server running and X shutdown, I tried explicitly adding the server option --webrtc-receive-video=yes, I tried with both --webrtc-renderer-fullscreen=yes and =no but no luck.
First of all, upgrade UV4L to the yesterday's release - there has temporarily been a regression affecting the streaming in some rare circumstances. Reboot and retry. In the second place, UV4L does not require an X server (it overlays the video on the HDMI display directly). What are you trying to stream to the Rpi, the PC camera or the PC desktop? Currently the latter only works with Firefox out-of-the-box (although it's easy to extend UV4L to work with any browser).

Re: Streaming to a RPi using UV4L

Posted: Mon Jan 02, 2017 7:48 pm
by robyf
RpiName wrote:First of all, upgrade UV4L to the yesterday's release - there has temporarily been a regression affecting the streaming in some rare circumstances. Reboot and retry. In the second place, UV4L does not require an X server (it overlays the video on the HDMI display directly). What are you trying to stream to the Rpi, the PC camera or the PC desktop? Currently the latter only works with Firefox out-of-the-box (although it's easy to extend UV4L to work with any browser).
Thanks I will try soon. I had tried with both the PC camera and a PC window with the same results (and yes, I had added the RPi hostname to the relevant configuration in about:config),

The RPi doesn't have any camera connected so I was using the dummy driver there, can this be the problem?
Also, is RPi 3B supported? I have seen at least the zero is not so I started wondering about the 3.

Re: Streaming to a RPi using UV4L

Posted: Tue Jan 03, 2017 2:11 am
by RpiName
robyf wrote:The RPi doesn't have any camera connected so I was using the dummy driver there, can this be the problem?Also, is RPi 3B supported? I have seen at least the zero is not so I started wondering about the 3.
The dummy driver itself isn't a problem. The RPi3 is supported. As an improvement you may want to entirely switch off webrtc in one direction, from Rpi to browser: –enable-webrtc-video, –enable-webrtc-audio, while leaving the --webrtc-receive counterparts on only.

I am assuming you are starting UV4L manually with the dummy driver from command line. Please give all the details.

Re: Streaming to a RPi using UV4L

Posted: Tue Jan 03, 2017 9:28 am
by robyf
Unfortunately still no luck. These are the versions I've currently installed:

Code: Select all

||/ Name                                   Version                     Architecture                    Description
+++-======================================-===========================-=======================-===========================================================
ii  uv4l                                   1.9.12-1                    armhf                   User space Video4Linux Framework Core
ii  uv4l-decoder                           1.8                         armhf                   Video Hardware Decoder support for the
ii  uv4l-dummy                             1.1                         armhf                   Dummy driver module for UV4L.
ii  uv4l-encoder                           1.12                        armhf                   Video Hardware Encoder support for the
ii  uv4l-raspidisp                         1.4                         armhf                   Capture Display driver for any Raspberry Pi.
ii  uv4l-renderer                          1.6                         armhf                   Video Renderer for the WebRTC Extension
ii  uv4l-server                            1.1.84                      armhf                   Streaming Server module for UV4L with HTTP/HTTPS front-end.
ii  uv4l-uvc                               1.9                         armhf                   Usb Video Class driver module for UV4L.
ii  uv4l-webrtc                            1.66                        armhf                   WebRTC extension for the
ii  uv4l-xscreen                           1.3                         armhf                   XScreen driver module for UV4L.
And this is the command I've been running from command line:

Code: Select all

uv4l --enable-server --driver dummy --server-option '--use-ssl=yes' --server-option '--ssl-private-key-file=/home/pi/selfsign.key' --server-option '--ssl-certificate-file=/home/pi/selfsign.crt' --verbosity=7 --server-option '--enable-webrtc-video=no' --server-option '--enable-webrtc-audio=no' --server-option '--webrtc-receive-video=yes' --server-option '--webrtc-renderer-fullscreen=yes' --server-option '--webrtc-receive-datachannels=yes' --server-option '--webrtc-receive-audio=yes'
and this is its output:

Code: Select all

<notice> [core] Trying driver 'dummy' from built-in drivers...
<warning> [core] Driver 'dummy' not found
<notice> [core] Trying driver 'dummy' from external plug-in's...
<notice> [driver] Dummy Video4Linux2 Driver built May 11 2016
<notice> [core] Device detected!
<notice> [core] Registering device node /dev/uv4l
Raspbian is fully updated and I've also just updated the firmware and disabled completely the X server.

Re: Streaming to a RPi using UV4L

Posted: Tue Jan 03, 2017 11:36 am
by RpiName
robyf wrote:And this is the command I've been running from command line:

Code: Select all

uv4l --enable-server --driver dummy --server-option '--use-ssl=yes' --server-option '--ssl-private-key-file=/home/pi/selfsign.key' --server-option '--ssl-certificate-file=/home/pi/selfsign.crt' --verbosity=7 --server-option '--enable-webrtc-video=no' --server-option '--enable-webrtc-audio=no' --server-option '--webrtc-receive-video=yes' --server-option '--webrtc-renderer-fullscreen=yes' --server-option '--webrtc-receive-datachannels=yes' --server-option '--webrtc-receive-audio=yes'
and this is its output:
<notice> [core] Registering device node /dev/uv4l[/code]

Raspbian is fully updated and I've also just updated the firmware and disabled completely the X server.
Add --auto-video_nr to the command line and retry. (by the way, it does not matter if you run X or not).

Re: Streaming to a RPi using UV4L

Posted: Tue Jan 03, 2017 2:53 pm
by robyf
RpiName wrote:Add --auto-video_nr to the command line and retry. (by the way, it does not matter if you run X or not).
The only thing that changed is that at startup it says:
<notice> [core] Registering device node /dev/video0

But still as before, it connects, I see the webcam output on the laptop in the "local" window but I just see the RPi desktop on its screen...

Re: Streaming to a RPi using UV4L

Posted: Tue Jan 03, 2017 5:59 pm
by RpiName
Try this one, I have tested it:

Code: Select all

uv4l --enable-server --driver dummy --server-option '--use-ssl=yes' --server-option '--ssl-private-key-file=/home/pi/selfsign.key' --server-option '--ssl-certificate-file=/home/pi/selfsign.crt' --verbosity=7 --server-option '--enable-webrtc-video=yes' --server-option '--enable-webrtc-audio=no' --server-option '--webrtc-receive-video=yes' --server-option '--webrtc-renderer-fullscreen=yes' --server-option '--webrtc-receive-datachannels=yes' --server-option '--webrtc-receive-audio=yes' --auto-video_nr
For some reasons, you need to use --enable-webrtc-video=yes (or remove it at all, as is the default). I'll report this flaw, but in the meanwhile you can use the above command.

Re: Streaming to a RPi using UV4L

Posted: Wed Jan 04, 2017 6:01 am
by robyf
This worked, thanks!

Is there a way to increase the resolution when streaming? When I try to stream a desktop window containing text it comes up completely unreadable.

Re: Streaming to a RPi using UV4L

Posted: Wed Jan 04, 2017 9:56 am
by RpiName
robyf wrote:Is there a way to increase the resolution when streaming? When I try to stream a desktop window containing text it comes up completely unreadable.
Sure, you'll have to set the first renderer window resolution (while still using the fullscreen mode). By default is 480x352 (small, but enough for camera output). But you can increase it to HD or Full HD. In this case, I suggest that you enable the hardware encoding/decoding via checkbox in the page. E.g.:

Code: Select all

--server-option=--webrtc-renderer-window=0 0 1280 720
don't use extra ' or " chars.

Re: Streaming to a RPi using UV4L

Posted: Thu Nov 02, 2017 5:38 am
by BenPiStudy
Hi All,
Thanks for this guide, I can share PC Camera's video to RPI using UV4L. But how can I share PC's screen to PRI? I cannot select "screen" from the webrtc page of Firefox or Chrome browser. I didn't use SSL so far, is it necessary to use SSL for screen sharing?

Thanks so much if you can help my questions.

Yours Sincerely,
Ben.

Re: Streaming to a RPi using UV4L

Posted: Thu Nov 02, 2017 4:08 pm
by RpiName
BenPiStudy wrote:
Thu Nov 02, 2017 5:38 am
Thanks for this guide, I can share PC Camera's video to RPI using UV4L. But how can I share PC's screen to PRI? I cannot select "screen" from the webrtc page of Firefox or Chrome browser. I didn't use SSL so far, is it necessary to use SSL for screen sharing?
You have to follow the instructions above. Make sure the UV4L Streaming Server is configured with secure HTTPS enabled (see the installation instructions). Afterwards you must explicitly enable screen sharing in Firefox from the "about:config" URL. In Chrome screen sharing is enabled with a command line option. If you are using self-generated certificates you must also whitelist your rpi hostname/domain in Firefox.

Re: Streaming to a RPi using UV4L

Posted: Tue Nov 21, 2017 10:10 pm
by amilino
Is it possible to use UV4L for making video available at

Code: Select all

/dev/video0
and then stream it over the ffmpeg. To avoid Browser issues with ssl, and screen capture stuff. I was reading this tutorial http://phoboslab.org/log/2013/09/html5- ... websockets.

If someone can write which commands need to be followed to have it working would be great. Also I am not sure about audio how to stream audio also in case of ffmpeg. My idea is to stream Raspbian screen with audio enabled.

This is what I have so far:

Code: Select all

curl http://www.linux-projects.org/listing/uv4l_repo/lpkey.asc | sudo apt-key add -
deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/stretch stretch main
sudo apt-get update
sudo apt-get install uv4l uv4l-raspicam
sudo apt-get install uv4l-server uv4l-xscreen uv4l-webrtc
uv4l --driver xscreen --auto-video_nr --display :0 --framerate 10 --server-option '--port=9000'
But after this I am stuck with https thing and also enabling this Chrome screen sharing.

Thank you in advance!

Re: Streaming to a RPi using UV4L

Posted: Thu Nov 23, 2017 9:48 pm
by RpiName

Re: Streaming to a RPi using UV4L

Posted: Thu Nov 23, 2017 9:53 pm
by amilino
Don't like it. Can I use Chrome or any browser without enabling some settings???

Re: Streaming to a RPi using UV4L

Posted: Thu Nov 23, 2017 10:10 pm
by amilino
Sorry but this is way to complicated and there is no tutorial step by step with exact commands for Raspberry, how to make things working without too much hassle. It is a pity, I give up, already spend hours on this not working stuff.

Re: Streaming to a RPi using UV4L

Posted: Thu Nov 23, 2017 10:28 pm
by RpiName
good luck..let us know if you find something easier.

Re: Streaming to a RPi using UV4L

Posted: Sun Nov 26, 2017 8:49 pm
by amilino
I would suggest noVNC, a remote desktop via web browser. Pure html5, no hidden ssl or some tweaks in Chrome or Firefox. Only thing is that you don't have sound. But you can se live picture of your raspberry pi in web browser, you can also control it with your mouse. I use dispmanx vnc. Installation was also super easy and light.

Re: Streaming to a RPi using UV4L

Posted: Sat Sep 29, 2018 8:25 am
by rabiach786
I am using UV4L WebRTC for audio/video streaming from Raspberry Pi 3 to PC in Chrome. but I am unable to stream audio/video from PC to Raspberry Pi 3. when I check the options for local stream to remote, It gives me "media and device permission error". In firefox, nothing is happening. so i am stuck here.

can anyone help me
regards
Rabia