Skip to content

Instantly share code, notes, and snippets.

@vadimstasiev
Last active June 14, 2021 01:08
Show Gist options
  • Save vadimstasiev/8aa09a77a3ce6efe4887601504d2a4e1 to your computer and use it in GitHub Desktop.
Save vadimstasiev/8aa09a77a3ce6efe4887601504d2a4e1 to your computer and use it in GitHub Desktop.

Install the fork of the mjpg streamer with the support for the raspberry pi cam

https://github.com/jacksonliam/mjpg-streamer.git

Enable the camera in the raspbian configuration settings accessed with:

sudo raspi-config

Test the streamer

mjpg_streamer -i "input_raspicam.so -x 1920 -y 1440 -fps 3 " -o "output_http.so -p 8090"

You can access the stream from ipaddress:8090/?action=stream

Create a service to start on boot

sudo nano /lib/systemd/system/mjpg-streamer.service

[Unit]
Description=Streams video with Raspberry Pi Camera
After=syslog.target
After=network.target

[Service]
Type=simple
User=www-data
Group=video
WorkingDirectory=/usr/local/bin
ExecStart=mjpg_streamer -i "input_raspicam.so -x 1920 -y 1440 -fps 3 " -o "output_http.so -p 8090"
Restart=always
RestartSec=5
Environment=

[Install]
WantedBy=multi-user.target
  • sudo systemctl daemon-reload

  • sudo systemctl enable mjpg-streamer.service

  • sudo systemctl start mjpg-streamer.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment