Daniel Robaszkiewicz

Rasp Player Tutorial

In this tutorial you will find a complete guide how to build your own cameras system accessible from android phone! All you need is:

  • At least one Raspberry Pi with camera

  • Android Phone

  • Computer (Windows/Linux/MacOS) with Docker application

TcpMultiplexer

We will setup TcpMultiplexerwhich will grab streams from Raspberries in the same network (you can use VPN if Raspberries are not in the same network physically) and then every android phone that will have our application RaspPlayerproperly configured can easily watch streams from Raspberries on the same network (again, you can also install VPN to you network on your phone and watch stream from every place around the world)

1. Setup your Raspberry (or Raspberries)

On your Raspberry Pi run:


sudo apt update
      

sudo apt upgrade
      

sudo apt install git
      

Clone repository to grab libcamera service files:


git clone https://github.com/modelingevolution/RaspPlayer.git
      

Then go to "LibcameraSetup" directory and copy files into right places:


cd RaspPlayer/LibcameraSetup
      

sudo cp libcamera-vid.service /etc/systemd/system/
      

sudo mkdir /etc/libcamera-vid
      

sudo cp libcamera-vid.conf /etc/libcamera-vid/
      

Finally, starting service:


sudo systemctl daemon-reload
      

sudo systemctl start libcamera-vid.service
      

sudo systemctl enable libcamera-vid.service
      

to check status:


sudo systemctl status libcamera-vid.service
      

Now, libcamera service, by default will be starting everytime when Raspberry will boot, with default parameters:


WIDTH=1920 HEIGHT=1080 FPS=24 VIDEO_PORT=6000
      

if you want change resolution, fps in streamed video etc. all you need to do is to change variables in libcamera-vid.confin /etc/libcamera-vid/directory and restart service.

Repeat the steps on other Raspberries.

2. Run TcpMultiplexer on your computer by using Docker

TcpMultiplexercode is available here

To run TcpMultiplexeryou need to pull our image by using this command in terminal:


docker pull engineersme/tcpmultiplexer:latest
      

and then:


docker run --name TcpMultiplexer -d -p 5066:80 -p 9001:9001 engineersme/tcpmultiplexer:latest -e ASPNETCORE_ENVIRONMENT="Docker" -e DOTNET_URLS="http://+:80;" -e ASPNETCORE_URLS="http://+:80;" --listen 0.0.0.0 --port 9001 --autostart
   

Now, TcpMultiplexerwill be available on http://localhost:5066/

3. Connect TcpMultiplexer with your Raspberries


Click "Connect" button on the left-top side of the page TcpMultiplexer connect

Write you Raspberry Pi hostname or IP in your local network (if you dont know, you can go on your router page and see the address of your Raspberry Pi) Write you tcp port of libcamera on Raspberry Pi (by default, we setup "6000" on port in libcamera.service). Then click connect.


TcpMultiplexer connected

You should see that TcpMultiplexer is receiving data from specified Raspberry Pi.

Repeat this steps with every Raspberry Pi that you want to connect.

4. Install RaspPlayer on Android phone

Code of RaspPlayer application is available hereYou can build your own apk or use latest builded version available here

All you need to do is to place apk on your phone and install it.

5. Configure RaspPlayer

Open RaspPlayeron your Android Phone

RaspPlayer start

Add TcpMultiplexerby clicking "Configure TcpMultiplexer", pass data related your TcpMultiplexerand click "Save".

RaspPlayer TcpConfiguration

Hostname is an ip address of your computer where TcpMuliplexeris running. In this example PC that running TcpMultiplexer in Docker has 192.168.0.10 address in local network. Port by default is 9001.

RaspPlayer Add Raspberry Pi

Next step is adding Raspberry Pi. You need to click "Add Raspberry Pi", write name that your registred Raspberry Pi will have and Raspberry Pi ip address in your network. After that click "Add Raspberry Pi " button.

RaspPlayer Preview

You should see preview with live stream of configured Raspberry Pi! If you cant see any preview after some time and you cant see connected clients on TcpMultiplexer page, probably you need to open tcp port! By default it's 9001

If you click on that preview you can switch to fullscreen mode.

RaspPlayer Fullscreen
Liked it?