-
Notifications
You must be signed in to change notification settings - Fork 3
Live Streaming with Pi
Ajay Ramachandran edited this page Nov 25, 2021
·
1 revision
The raspberry pi can be used as a camera feed forwarder. To do this, connect a USB capture card to the pi, and it will act like a normal video source.
If using a runcam, this can be connected with an AV capture card and a micro USB to TV-Out cable.
On the rasperry pi, install ffmpeg, and nginx with the rtmp module
sudo apt install ffmpeg nginx libnginx-mod-rtmp -y
Setup the nginx config to be an RTMP forwarder with a low buffer (to reduce latency)
load_module /usr/lib/nginx/modules/ngx_stream_module.so;
load_module /usr/lib/nginx/modules/ngx_rtmp_module.so;
worker_processes 1;
events {
}
rtmp {
server {
listen 1935;
chunk_size 2096;
application live {
live on;
record off;
}
}
}
Restart the nginx service
sudo service nginx reload
You can now stream the video signal with ffmpeg
ffmpeg -re -i /dev/video0 -f flv -b:v 3000k rtmp://localhost/live
If there are multiple cameras connected, increment the number beside /dev/video
You can view this steam in OBS or VLC by opening up a network stream with rtmp://<IP of RaspberryPi>/live
. In OBS, you use a "Media Source".
- Getting started
- Environment Variables
- Compiling the SBG Library on Linux\Unix\WSL
- Developing on Windows with VSCode
- Set Environment Variable In Vscode With The Cmake Plugin
- Creating Unit Tests
- Cross compiling for the Raspberry Pi
- Info and Error Logging in the Rocket Code
- Send Folder via SSH
Configuration:
Raspberry Pi Setup:
- Add a new wifi network on the Raspberry Pi
- Connect to Raspberry Pi via SSH
- Important Notes About Setting Up Raspberry Pi
- Running Emulation of Raspberry Pi
Logging Format: