Add README, fix docstring filename
This commit is contained in:
1 parent
083b6ba25b
commit
8526a1bc39
2 files changed
+55
-1
No files matched your search
@@ -0,0 +1,54 @@
|
|||||||
|
# raspi-cam
|
||||||
|
|
||||||
|
MJPEG-Stream-Server für die Raspberry-Pi-Kamera. Startet `rpicam-vid` einmalig als Singleton-Prozess und verteilt die Frames per Flask an beliebig viele Viewer. Bei einem Absturz von `rpicam-vid` erfolgt ein automatischer Neustart.
|
||||||
|
|
||||||
|
## Voraussetzungen
|
||||||
|
|
||||||
|
- Raspberry Pi mit angeschlossener Kamera
|
||||||
|
- `rpicam-vid` (rpicam-apps)
|
||||||
|
- Python 3 mit `flask` und optional `python-dotenv`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install flask python-dotenv
|
||||||
|
```
|
||||||
|
|
||||||
|
## Start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Danach erreichbar unter:
|
||||||
|
|
||||||
|
| URL | Beschreibung |
|
||||||
|
|---|---|
|
||||||
|
| `http://<host>:8080/` | HTML-Seite mit Live-Stream |
|
||||||
|
| `http://<host>:8080/stream` | MJPEG-Stream |
|
||||||
|
| `http://<host>:8080/stream.mjpg` | MJPEG-Stream (vehicle-counter kompatibel) |
|
||||||
|
|
||||||
|
## Konfiguration
|
||||||
|
|
||||||
|
Die Konfiguration erfolgt über Umgebungsvariablen oder eine `.env`-Datei im Projektverzeichnis.
|
||||||
|
|
||||||
|
| Variable | Beschreibung | Default |
|
||||||
|
|---|---|---|
|
||||||
|
| `APP_HOST` | Bind-Adresse | `0.0.0.0` |
|
||||||
|
| `APP_PORT` | HTTP-Port | `8080` |
|
||||||
|
| `CAM_MODE` | Sensor-Modus | `1640:1232` |
|
||||||
|
| `CAM_WIDTH` | Ausgabebreite | `640` |
|
||||||
|
| `CAM_HEIGHT` | Ausgabehöhe | `480` |
|
||||||
|
| `CAM_FRAMERATE` | Ziel-FPS | `20` |
|
||||||
|
| `CAM_QUALITY` | JPEG-Qualität (1–100) | `30` |
|
||||||
|
| `CAM_ROTATION` | Rotation (0/90/180/270) | leer |
|
||||||
|
|
||||||
|
Beispiel `.env`:
|
||||||
|
|
||||||
|
```
|
||||||
|
CAM_MODE=1640:1232
|
||||||
|
CAM_WIDTH=820
|
||||||
|
CAM_HEIGHT=616
|
||||||
|
CAM_FRAMERATE=20
|
||||||
|
CAM_QUALITY=50
|
||||||
|
CAM_ROTATION=
|
||||||
|
APP_PORT=8080
|
||||||
|
```
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
cam.py – Raspberry Pi Camera MJPEG Stream Server
|
app.py – Raspberry Pi Camera MJPEG Stream Server
|
||||||
Startet rpicam-vid als Singleton-Prozess und verteilt Frames per Flask.
|
Startet rpicam-vid als Singleton-Prozess und verteilt Frames per Flask.
|
||||||
Erreichbar unter /stream und /stream.mjpg (vehicle-counter kompatibel).
|
Erreichbar unter /stream und /stream.mjpg (vehicle-counter kompatibel).
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user