Update 6.0.0
This commit is contained in:
parent
bb0b7539a0
commit
c8db437b79
63 changed files with 3667 additions and 737 deletions
34
files/services/S50usb_camera-single
Executable file
34
files/services/S50usb_camera-single
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/sh
|
||||
# USB Camera Service
|
||||
# Credit: destinal & Guilouz
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "Starting USB Camera..."
|
||||
V4L_DEVS=$(v4l2-ctl --list-devices | grep -A1 usb | sed 's/^[[:space:]]*//g' | grep '^/dev')
|
||||
CREALITY_CAMS=$(v4l2-ctl --list-devices | grep -E 'CREALITY|CCX2F3298' | wc -l)
|
||||
if [ "x$V4L_DEVS" = "x" -o $CREALITY_CAMS -gt 0 ]; then
|
||||
echo "Error: No third party camera found or you use a Creality camera!"
|
||||
exit 1
|
||||
fi
|
||||
PORT=8080
|
||||
for V4L_DEV in $V4L_DEVS; do
|
||||
/opt/bin/mjpg_streamer -b -i "/opt/lib/mjpg-streamer/input_uvc.so -d $V4L_DEV -r 1280x720 -f 15" -o "/opt/lib/mjpg-streamer/output_http.so -p $PORT"
|
||||
PORT=`expr $PORT + 1`
|
||||
done
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping USB Camera..."
|
||||
killall -q mjpg_streamer
|
||||
;;
|
||||
restart|reload)
|
||||
"$0" stop
|
||||
sleep 1
|
||||
"$0" start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/S50usb_camera {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
Loading…
Add table
Add a link
Reference in a new issue