Last active
November 1, 2015 04:09
-
-
Save cattaka/41a4764530e6f3e06b79 to your computer and use it in GitHub Desktop.
/etc/init.d/mjpg_streamer.sh
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
#!/bin/sh | |
PORT="18080" | |
ID="cattaka" | |
PW="potato" | |
SIZE="640x480" | |
FRAMERATE="2" | |
start() { | |
echo -n "Starting mjpg_streamer: " | |
for i in `seq 1 1 30` | |
do | |
echo "Waiting for create /dev/video0" | |
if [ -c /dev/video0 ]; then break; fi | |
sleep 1 | |
done | |
export LD_LIBRARY_PATH=/usr/local/lib | |
/usr/local/bin/mjpg_streamer \ | |
-b \ | |
-i "input_uvc.so -f $FRAMERATE -r $SIZE -d /dev/video0 " \ | |
-o "output_http.so -w /usr/local/www -p $PORT -c $ID:$PW" | |
return 0 | |
} | |
stop() { | |
killall mjpg_streamer | |
return 0 | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment