Created
December 29, 2014 05:27
-
-
Save tmbdev/66f71f8fc8973f9eb4c8 to your computer and use it in GitHub Desktop.
simple webcam server in Shell
This file contains hidden or 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/bash | |
port=8899 | |
send_header() { | |
cat <<EOF | |
HTTP/1.0 200 OK | |
Content-Type: image/jpeg | |
Refresh: 10 | |
Connection: Close | |
EOF | |
} | |
while true; do | |
( | |
{ send_header; vgrabbj -i sxga -d /dev/video0 -a -z 10 -q 100; } | nc -l $port | |
) > /tmp/server.out 2>&1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment