droidcam-with-octoprint/services/droidcam-streamer.service
2023-09-29 23:26:23 +02:00

18 lines
734 B
Desktop File

[Unit]
Description=DroidCam streaming
BindsTo=droidcam.service
StartLimitIntervalSec=0
[Service]
Type=simple
# this is cursed
ExecStart=/home/pi/go/bin/mjpeg-server -a ":8080" -b gaysex -- bash -c 'while [[ true ]]; do gst-launch-1.0 -v v4l2src device=/dev/video1 ! videoconvert ! video/x-raw,format=I420 ! v4l2jpegenc ! multipartmux boundary=gaysex ! filesink location=/dev/stdout || true; done'
Restart=always
RestartSec=5
# Old transcoding command, ffmpeg hammered the CPU way too much and doesn't have support for the v4l2 mjpeg encoder. gstreamer performs leagues better
# ExecStart=/home/pi/go/bin/mjpeg-server -a ":8080" -- ffmpeg -i /dev/video1 -fflags nobuffer -an -r 15 -f mpjpeg -q 2 -
[Install]
WantedBy=default.target