Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brianlesko/rpi-tcp-cam-server
Run a low latency camera server on the raspberry pi
https://github.com/brianlesko/rpi-tcp-cam-server
Last synced: about 20 hours ago
JSON representation
Run a low latency camera server on the raspberry pi
- Host: GitHub
- URL: https://github.com/brianlesko/rpi-tcp-cam-server
- Owner: BrianLesko
- Created: 2024-04-20T20:43:56.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-02T18:30:44.000Z (5 days ago)
- Last Synced: 2024-11-02T19:21:48.530Z (5 days ago)
- Language: Shell
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# TCP Camera Stream for Raspberry Pi
The video stream here is easy to implement and came in at about 240ms of latency over wifi and 180ms with a direct hostpot hosted on the raspberry pi. This repository is one in several aimed at testing the different options for [streaming video from a raspberry pi](https://www.raspberrypi.com/documentation/computers/camera_software.html#tcp) with raspberry pi camera module V3.
Using the same raspberry pi source for testing UDP resulted in latency between 120ms, but it had the tendency to aggregate a buffer even with no buffer flags.
![Latency Analysis](latency.jpg)
## Software Dependencies
This code uses the following libraries:
- `libcamera`
- `rpicam-apps`
## Hardware Dependencies
Mipi camera interface
## Usage
1. Have a raspberry pi with rpi camera plugged in, powered up.
2. Update and upgrade the rpi. Then run
```
sudo nano /boot/firmware/config.txt
```
and add the line
```
start_x=1```
3. Add your user to the camera group and then reboot
```
sudo usermod -aG video lesko
sudo reboot
```4.Then check if the camera is detected.
```
vcgencmd get_camera
```5. Clone this repository to your server device and client device
6. Make sure the scripts are executable by running these commands on both devices
```
chmod +x camera_server.sh
chmod +x receive.sh
```7. run the bash script on your camera server device
```
./camera_server.sh
```
The IP will be printed after running
If there is a process on port 8000 already you can kill it with
```
sudo kill -9 $(sudo lsof -t -i :8000)
```8. run the client script on your recieving device and pass in the IP printed from the server.
```
./receive.sh IP
```This will start the video stream transmission
## About
This code is written for use with the bash (bourne again shell) language for use with a linux camera server running libcamera and rpicam-apps and a client that has ffmpeg installed.
╭━━╮╭━━━┳━━┳━━━┳━╮╱╭╮ ╭╮╱╱╭━━━┳━━━┳╮╭━┳━━━╮
┃╭╮┃┃╭━╮┣┫┣┫╭━╮┃┃╰╮┃┃ ┃┃╱╱┃╭━━┫╭━╮┃┃┃╭┫╭━╮┃
┃╰╯╰┫╰━╯┃┃┃┃┃╱┃┃╭╮╰╯┃ ┃┃╱╱┃╰━━┫╰━━┫╰╯╯┃┃╱┃┃
┃╭━╮┃╭╮╭╯┃┃┃╰━╯┃┃╰╮┃┃ ┃┃╱╭┫╭━━┻━━╮┃╭╮┃┃┃╱┃┃
┃╰━╯┃┃┃╰┳┫┣┫╭━╮┃┃╱┃┃┃ ┃╰━╯┃╰━━┫╰━╯┃┃┃╰┫╰━╯┃
╰━━━┻╯╰━┻━━┻╯╱╰┻╯╱╰━╯ ╰━━━┻━━━┻━━━┻╯╰━┻━━━╯
follow all of these for pizza :)