Skip to content

Instantly share code, notes, and snippets.

@thanhminhmr
Created November 24, 2024 10:50
Show Gist options
  • Save thanhminhmr/2edb88e7aed434e00993f5cefb00397c to your computer and use it in GitHub Desktop.
Save thanhminhmr/2edb88e7aed434e00993f5cefb00397c to your computer and use it in GitHub Desktop.
systemd service for streaming camera feed on Raspberry Pi Zero 2w using `ffmpeg` only
[Unit]
Description=Low-res Camera Stream
BindsTo=dev-video0.device
After=dev-video0.device
[Service]
ExecStart=ffmpeg -hide_banner -loglevel warning -i /dev/video0 -listen 1 -c:v h264_v4l2m2m -b:v 1000k -f mpegts http://0.0.0.0:8080
Restart=always
RestartSec=1s
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment