JeanVt
Posts: 3
Joined: Mon Apr 16, 2018 10:26 am

WebRTC peer without a browser

Mon Apr 16, 2018 10:55 am

Hi,

I have a small project with my Raspberry Pi 3 and WebRTC, I tried searching information, but I'm a bit lost. Could you please guide me to the most appropriate and up to date solution for my needs ?

What I want to do is a kind of intercom system:
- The PI has a USB webcam, speakers and a microphone (but no screen).
- From an external device, using a browser, I want to dispaly a web page hosted on the Pi, see the camera output, and communicate both ways with the microphone/speakers.

I learned about WebRTC, and followed simple tutorials to set up a signaling server and a web page, and I was able to quickly set up a video call between the Pi and my phone, using a browser on both sides.
Now, I would like to have the same thing but without a browser on the Pi side. I want to programmatically join the WebRTC "room", share audio/video, and play other side's audio on the speakers.

I found many messages on forums giving advice for similar situations. They mention UV4L, Janus, EasyRTC, OpenWebRTC, node-webrtc, and other products... But I'm having trouble understanding what each of them does and if they are really what I'm looking for. Also, I'm not sure if I can trust information dated from several years ago.

Could you please help me ?
Thanks.

JeanVt
Posts: 3
Joined: Mon Apr 16, 2018 10:26 am

Re: WebRTC peer without a browser

Mon Apr 16, 2018 9:03 pm

I just tried UV4L, but it doesn't seem to recognize my webcam (although the webcam worked fine in my previous WebRTC tests from the browser).

Code: Select all

$ uv4l --driver uvc --device-id 0ac8:301b
<notice> [core] Trying to loading driver 'uvc' from built-in drivers...
<notice> [core] Loading driver 'uvc' from external plug-in's...
<error> [core] Video functionality not found
<alert> [core] No device detected
I also tried webrtc-streamer (https://github.com/mpromonet/webrtc-streamer/), which works fine for streaming my webcam, but it doesn't look like I can receive audio from the other side using this (correct me if I'm wrong).

EDIT:
So I installed and ran mjpg-streamer, and used it as a source for a "virtual" camera in UV4L. Then, UV4L seems to do exactly what I want (I still need to do deeper tests, but that's enough for today).
I don't like that solution, but it looks okay for now. I'll try like this until I face some issue or someone suggests a better way.

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

Re: WebRTC peer without a browser

Tue Apr 17, 2018 8:11 am

are you sure the webcam is uvc compliant?

in any case, uvc or not uvc, you can make uv4l the kernel driver directly, e.g.:

modprobe uvcvideo (or other video kernel module)

this will register e.g. /dev/video1.

then:

uv4l --external-driver --device-name=video1 --server-option '--port=9000'

JeanVt
Posts: 3
Joined: Mon Apr 16, 2018 10:26 am

Re: WebRTC peer without a browser

Tue Apr 17, 2018 7:06 pm

Yes, that works, thanks!
I didn't know about the --external-driver option. I should have read the docs, sorry.

kentloog
Posts: 1
Joined: Thu Nov 22, 2018 7:23 pm

Re: WebRTC peer without a browser

Thu Nov 22, 2018 7:28 pm

Hi JeanVt,

I have a similar project in mind. How far did you get with your approach and what was your solution to streaming PI video with no browser. If possible, can you share your code too? I would really need your help.

Thanks

Return to “Beginners”