MULTI-STREAMING WITH MULTIPLE RASPBERRY, ONE PC AS A SERVER, AND A SINGLE INTERNET CONNECTION

Job ID: 38994791

Budget: €250 – €750 EUR

I want the image of two Raspberry webcams (the ones that use the specific Raspberry connector, i.e. not USB) and the sound of two USB microphones of two Raspberrys to be accessible from the Internet simultaneously. The goal is to achieve a system that is scalable later to transmit image and sound from up to 10 Raspberrys simultaneously from the same Internet connection.

To do this, I intend it to use Raspberry's software called UV4L, which should connect to a Janus Gateway server that is on a PC with the Linux Ubuntu operating system. On this Ubuntu is installed the Apache web server and a reverse proxy module. I've tried setting it up, but it doesn't work. I will give remote access to both the PC and two Raspberrys, understanding that if we manage to make it work with two it will be easily scalable up to 10 Raspberry. They will all be within the same local network and there will be a single Internet connection over which to broadcast. UV4L does not work with 64-bit operating systems, it also does not work well with the latest version of the Raspberry operating system and in fact how it works best is with the version called "Buster", but I use it because it gives me very good latency broadcasting with an individual web server from each Raspberry.

I don't see any error when running the software called "Janus Gateway" on the Ubuntu PC. I access the folder "cd /opt/janus/bin" and run "./janus" without any apparent error. Janus has been compiled to support the h264 codec.

On the Apache web server I have a web page with JavaScript that serves as a client.

Within that website I have a "play" button to start streaming video and audio.

I press the "play" button but it doesn't work.

I don't know why it doesn't work, as I don't get error messages.

The last thing I did was reinstall Janus Gateway and compile it to support the h264 codec.

UV4L is capable of setting up a web server and through its own server it renders the web, showing a video and audio stream. Unfortunately I can't use multiple web hosts at once.

If I set up a DMZ on the router pointing to the local IP of the Raspberry and on the Raspberry I have a UV4L web server, then I can access the video and audio of a Raspberry from the Internet, but I can't assign a DMZ to each Raspberry.

UV4L uses WebRTC technology, thanks to which it has very low audio and video latencies, but WebRTC uses many unpredictable communication ports with TCP and UDP traffic, which does not allow me to restrict some ports so that I can share the available ports between several streams.

I have found a solution, but it is not very good. What I do is use several Internet connections. Most Internet companies do not allow me in Spain (my country) to have more than one Internet connection per address. What I do is install a computer on another Internet connection.

That computer doesn't have to be a PC, it can be a Raspberry or even an Orange PI. The idea is that those computers are VPN servers and their clients are my Raspberry. You see, the idea is to race small robotic cars that use a Raspberry and that can be controlled from the Internet.
In my botched solution, i.e. the bad solution I'm using for every small car with Raspberry I have a web server on the Raspberry itself, an internet connection and a computer that acts as a VPN server.

I use IPTABLES to remap data traffic between the real card and the virtual VPN card.

The end result is that I can access my Raspberry through a friend's or my parent's internet connection, while the Raspberry stays next to me connected to my Wifi, but using someone else's internet through my own internet. This forces me to pay several Internet and to have a computer, (even if it is an Orange Pi Zero 3 that costs less than 30 euros) for each car.

Being able to use Janus Gateway to manage all the video and audio streaming from all Raspberrys in all small cars would be a better, sleeker, more economical (in the long run) and better performing solution.

The Raspberry is connected to an intermediate circuit to control motors and servo motors via the GPIO port. Each one controls 4 motors and 2 servo motors. They sell me some kits to assemble the strollers, although you have to buy the Raspberry, the USB microphone and the batteries separately. The manufacturer of the Kits provides me with some classes programmed in Python to manage motors and servomotors. I've created a Python application that leaves a communications port listening waiting to receive a JSON. In the web server that allows you to mount UV4L I have incorporated a JavaScript that controls the keystroke event of the keyboard, when you press a key I send a JSON to a certain communication port of a certain Internet IP corresponding to a connection in which there is a Raspberry connected and I have configured a DMZ in the router pointing to the local IP of that Raspberry. This way, when we send the JSON from JavaScript there is a Python program listening to it. Obviously, I have programmed that every time the Raspberry integrated in the stroller is turned on, the Python program will be loaded to leave that communications port listening.
I don't think the remote control is a problem, (in any case, I will be the one in charge of it, its task will be exclusively the transmission of simultaneous streaming). I can have the remote control taken care of independently and simultaneously through a single communications port, which makes things much easier. Therefore, I only want to be able to simultaneously view several video and audio streams, from two or more Raspberry at the same time from a web page, and I understand that this must necessarily be done by integrating with a Janus Gateway server with UV4L. In any case, if I could achieve the same through another means working under the same and unique Internet connection where both small cars with Raspberry and a PC with Ubuntu that acts as a server would be, then, I would also work as long as the latencies are as low as with UV4L.

5 POINTS TO KEEP IN MIND
1 - I would like to know how much is the total cost of the fully finished work, so that it does not become a surprise, including both that it works as expected and the necessary documentation so that I can replicate it.

2 - I will consider the work as finished when in a browser tab I can see and listen to the streaming from a Raspberry, while, at the same time, that is, simultaneously, in another tab you can access the video and audio streaming from the other Raspberry, all with a latency no higher than that offered by UV4L, with the same number of frames per second, that is, therefore with the same fluidity and with a resolution of at least 1280 x 720, any other option that does not achieve this, which is my goal, would be considered unfinished.
I will pay when it is obtained.

3 - I have a PC with Ubuntu 24 and I will provide remote access to it through the application called "nomachine". I will also provide remote access to two Raspberries through VNC. Using nomachine or VNC is basically indifferent, I use nomachine on Ubuntu and VNC on Raspberry for convenience. I have to do the configuration on my machines using the remote control provided for this purpose.

4 - I want practical and direct documentation of what has been achieved and how it works, because it is not only about making it work, but about being able to replicate it in the future and for that I need to understand as best as possible what was going wrong and how it works now and how to replicate it. Personally, when I learn something I usually create tutorials at a basic level as if they were designed for idiots. Both for myself when I don't remember it in the future and to share them with other people.

5 - Do you have experience with Janus Gateway and UV4L? Could you tell me, of all the Janus Gateway configuration files, which ones need to be modified for this case? I've already tried to hire several people who didn't know how to set up Janus Gateway in conjunction with UV4L, and they've abandoned the project. Please, if you don't know how to do it and your idea is to start investigating it once you start working, tell me in advance. Obviously, I will prioritize those who do know how to do it.
Related categories: Apache HTML