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

Re: Native WebRTC extension for UV4L now ready!

Fri Jan 29, 2016 11:19 pm

arapostol wrote: {"iceServers":[{"urls":"turn:TURNIP/","username":"[email protected]","credential":"test"}]}

I assume that the above account on the TURN server *is valid* this time and not one that you took from the previous list on github or a fake one...
arapostol wrote: 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..?
Using TURN for relaying is usually the solution for the most complex network scenarios. If your operator is really blocking the UDP traffic for some reasons, you may want to try with TCP (see the manual for the corresponding option).

EDIT: from the sdp it seems you only have TCP candidates.. is the sdp complete?
You may want to send me your IP privately so I can give a try to see what is happening.

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

Re: Native WebRTC extension for UV4L now ready!

Sat Jan 30, 2016 9:17 am

Ok, maybe I found bug. I think the server-option = --webrtc-ice-servers doesn't have any effect. Having it enabled or not you always have to feed the same info into the Optional ICE Server at the UV4L WebRTC main page. This did the trick for me.

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

Re: Native WebRTC extension for UV4L now ready!

Sat Jan 30, 2016 12:44 pm

arapostol wrote:Ok, maybe I found bug. I think the server-option = --webrtc-ice-servers doesn't have any effect. Having it enabled or not you always have to feed the same info into the Optional ICE Server at the UV4L WebRTC main page. This did the trick for me.
Glad to hear it works now. But It's not a bug. The command line affects the server peer, while the page affects the client peer. I did tell you to specify the servers on both server and client side initially (just to be sure).

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

Re: Native WebRTC extension for UV4L now ready!

Fri Feb 05, 2016 2:32 pm

Today news:
As a further improvement to the hardware encoded video from/to the Raspberry, also Full HD 1920x1080 will be possible with UV4L. Stay tuned, the feature will be ready soon!

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

Re: Native WebRTC extension for UV4L now ready!

Sun Feb 28, 2016 7:25 pm

echoing linux-projects.org, UV4L will support the Janus WebRTC Gateway soon. It's one more possibility for joining videoconferences "on the cloud":

original news:
http://www.linux-projects.org/modules/n ... toryid=191

What is Janus?
https://janus.conf.meetecho.com/

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

Re: Native WebRTC extension for UV4L now ready!

Fri Mar 04, 2016 10:02 pm

From a recent news appeared on http://linux-projects.org:
with UV4L it's now possible to make a Raspberry Pi optionally equipped with camera, microphone, speakers and display a full WebRTC-compliant peer able to connect to a given Janus Gateway and create or join a given video room "on the cloud" for publishing or receiving audio/video live streams to or from any participants. There is no need of any browser installed on the Raspberry Pi!
Original news:
http://www.linux-projects.org/modules/n ... toryid=194

User avatar
Elliott B
Posts: 92
Joined: Thu Jan 09, 2014 11:58 pm

Help with streaming options

Mon Jun 25, 2018 8:36 am

I'm trying the below command, and according to the console output, it accepts my settings, but when I access it at https://x.x.x.x:9000/stream in Chrome, it loads the mjpeg stream and the bandwidth is 16Mbps (measured in iStat Menus). How do I get the 500Kbps h264 stream?

I also tried https://x.x.x.x:9000/stream/webrtc and click the green Call button, and then I get what looks like an h.264 video, but the frame rate is very low (about 5 seconds per frame), and the Pi load average goes through the roof (above 6). Do I have to enable hardware encoding somehow?

My goal is to stream over the internet to an iOS device with low latency. This is a Pi Zero W running Raspbian Stretch Lite with a Pi Cam v2.

Code: Select all

uv4l \
--auto-video_nr yes \
--verbosity 7 \
--driver raspicam \
--encoding h264 \
--bitrate 500 \
--width 640 \
--height 480 \
--framerate 15 \
--vflip \
--server-option '--use-ssl=yes' \
--server-option '--ssl-private-key-file=/home/pi/selfsign.key' \
--server-option '--ssl-certificate-file=/home/pi/selfsign.crt' \
--server-option '--enable-webrtc=yes' \
--server-option '--enable-webrtc-video=yes' \
--server-option '--enable-webrtc-audio=no' \
--server-option '--port=9000' \

<notice> [core] Trying to loading driver 'raspicam' from built-in drivers...
<notice> [core] Loading driver 'raspicam' from external plug-in's...
<notice> [driver] Dual Raspicam & TC358743 Video4Linux2 Driver v1.9.60 built Jan  6 2018
<notice> [driver] Detected camera imx219, 3280x2464
<notice> [driver] Selected format: 640x480, encoding: h264, H264 Video Compression
<notice> [driver] Framerate max. 15 fps
<info> [driver] ROI: 0, 0, 1, 1
<notice> [driver] H264 costant bitrate: 500
<notice> [core] Device detected!
<notice> [core] Registering device node /dev/video0
By the way, is there any way to have uv4l log error messages locally? I don't have a syslog daemon.

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

Re: Native WebRTC extension for UV4L now ready!

Mon Jun 25, 2018 8:45 am

I also tried https://x.x.x.x:9000/stream/webrtc and click the green Call button, and then I get what looks like an h.264 video, but the frame rate is very low (about 5 seconds per frame), and the Pi load average goes through the roof (above 6). Do I have to enable hardware encoding somehow?
Yes, there should be a checkbox on the page that allows you to enable hw encoding. The quality of stream in WebRTC depends on quality of network connection. Also, you have to understand, that Pi zero is not a perfect choice to stream high-quality real-time video, as it's quite weak.
By the way, is there any way to have uv4l log error messages locally? I don't have a syslog daemon.
Try to run your command with "--verbosity=8 -f" flags.

User avatar
Elliott B
Posts: 92
Joined: Thu Jan 09, 2014 11:58 pm

Re: Native WebRTC extension for UV4L now ready!

Mon Jun 25, 2018 9:03 am

Thanks, -f is what I needed!
I do realize the Zero has a weak CPU, but I want to see what I can get with it's GPU-encoding, and if I have to upgrade to a Pi3, then I will.

That's interesting, the checkbox on the WebRTC page does help. The description there is confusing though, I thought that was for hardware decoding on the client computer. It says:
NOTE: if your browser does not support the hardware codec yet, try Firefox with the codec plugin enabled or a recent version of Chrome.
Is there no way to set this in the command-line startup options? I want to make a simple player without any buttons.

How can I get the WebRTC to work on iOS? The built-in /stream/webrtc page does not work in MobileSafari.

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

Re: Native WebRTC extension for UV4L now ready!

Mon Jun 25, 2018 9:34 am

To know how to customize UV4L, refer to this example:
https://www.linux-projects.org/uv4l/tut ... detection/

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

Re: Native WebRTC extension for UV4L now ready!

Mon Jun 25, 2018 9:35 am

Yes, you can enable/disable hw encoding manually when you want. Please, read about webrtc signaling here if you want to implement your own solution. And yes, it's possible to make it work on iOS (I already did it). Best option - uv4l WebRTC extension with your own implementation/wrapper.
The built-in /stream/webrtc page does not work in MobileSafari.
Make sure you have enabled hw encoding and you're in the same local network with your RPi.

User avatar
Elliott B
Posts: 92
Joined: Thu Jan 09, 2014 11:58 pm

Re: Native WebRTC extension for UV4L now ready!

Tue Jun 26, 2018 3:30 pm

The face detection is a good example, but I don't have very much javascript knowledge. Do you have any other example to share that works on iOS?

User avatar
Elliott B
Posts: 92
Joined: Thu Jan 09, 2014 11:58 pm

Re: Native WebRTC extension for UV4L now ready!

Sat Jun 30, 2018 12:59 pm

One thing I learned: iOS won't allow HTML5 video tags unless the play action is specifically triggered by a button. So the facedetection example has to be modified.

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

Re: Native WebRTC extension for UV4L now ready!

Sat Jun 30, 2018 1:26 pm

Try to add autoplay playsinline options to the video tag.

User avatar
Elliott B
Posts: 92
Joined: Thu Jan 09, 2014 11:58 pm

Re: Native WebRTC extension for UV4L now ready!

Wed Jul 11, 2018 4:41 am

Is there some documentation of the web socket commands?
In the example code I see this:

Code: Select all

force_hw_vcodec: true,
vformat: 30, /* 30=640x480, 30 fps */
trickle_ice: true
The documentation shows similar options, but they use different syntax, so I am trying to figure out how to use other commands. Is there a list of options for vformat?
–webrtc-trickle-ice [=arg(=yes)] (=no)
–webrtc-enable-hw-codec [=arg(=yes)] (=yes)

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

Re: Native WebRTC extension for UV4L now ready!

Wed Jul 11, 2018 7:52 am

Elliott B wrote:
Wed Jul 11, 2018 4:41 am
Is there some documentation of the web socket commands?
In the example code I see this:

Code: Select all

force_hw_vcodec: true,
vformat: 30, /* 30=640x480, 30 fps */
trickle_ice: true
The documentation shows similar options, but they use different syntax, so I am trying to figure out how to use other commands. Is there a list of options for vformat?
–webrtc-trickle-ice [=arg(=yes)] (=no)
–webrtc-enable-hw-codec [=arg(=yes)] (=yes)
See the --webrtc-video-format option from "man uv4l-server". It lists the possible values for the vformat websocket option. If specified, the options passed in the websocket message have the highest priority.

At the moment those are the only options that can be passed through the websocket. However,at any time almost all other options can be modified on-the-fly with the REST API (i.e. a single HTTP/HTTPS call). The modified options take effect from the next webrtc session on.

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 13 guests