You are not logged in.

#1 2016-09-07 17:52:26

HiImTye
Member
From: Nanaimo, BC, Canada
Registered: 2012-05-09
Posts: 1,061

MJPG-Streamer systemd Socket

so I've never made a systemd service or socket before, but I basically copied the files for smbd as a template and entered the values I needed for mjpg-streamer. if I start mjpg.service it works fine, but if I start mjpg.socket instead, it starts properly but when I go to view the webpage I get a webpage with only 'Bad response. The server or forwarder response doesn't look like HTTP.' here are the files that I made:

mjpg.service

[Unit]
Description=Job that runs mjpg_streamer
After=network.target

[Service]
Type=simple
Enviroment=statedir=/usr/bin
ExecStart=/usr/bin/mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 1280x720 -q 100 -f 5" -o "output_http.so -w /usr/share/mjpeg-streamer/www -p 8080"
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target

mjpg@.service

[Unit]
Description=MJPG-Streamer Server Instance

[Service]
ExecStart=/usr/bin/mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 1280x720 -q 100 -f 5" -o "output_http.so -w /usr/share/mjpeg-streamer/www -p 8080"
ExecReload=/bin/kill -HUP $MAINPID
StandardInput=socket

mjpg.socket

[Unit]
Description=MJPG-Streamer socket

[Socket]
ListenStream=8080
Accept=yes

[Install]
WantedBy=sockets.target

Last edited by HiImTye (2016-09-07 17:53:01)

Offline

Board footer

Powered by FluxBB