Created
October 11, 2020 07:11
-
-
Save paulmey/81591c4ef4016f4ce5d804e062c515f0 to your computer and use it in GitHub Desktop.
Files to start mjpg_streamer automatically when /dev/video0 is available
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/udev/rules.d/99-mjpg-streamer-v4l.rules | |
# Tells udev to tell systemd to start mjpg-streamer when /dev/video0 pops up | |
SUBSYSTEM=="video4linux", KERNEL=="video0", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="mjpg-streamer@$name.service" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/mjpg-streamer@.service | |
[Unit] | |
Description=MJPG Streamer service for /dev/%i | |
# stop service if device disappears | |
BindsTo=dev-%i.device | |
After=dev-%i.device network.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/local/bin/mjpg_streamer -i "input_uvc.so -d /dev/%i" -o output_http.so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This didn't work for me on my Raspberry Pi. Any help you might be able to offer me?