Created
February 5, 2012 11:26
-
-
Save davedarko/1744862 to your computer and use it in GitHub Desktop.
24h Webcam Script
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/bash | |
time=$(date +%H%M) | |
HOME=/path/to/pic | |
webcam="/dev/video0" | |
if [ -c "/dev/video1" ] ; | |
then ( webcam="/dev/video1" ) | |
fi | |
cd $HOME | |
cvlc v4l2://$webcam --scene-format=png --video-filter=scene --run-time=3 --scene-ratio=48 --scene-prefix=$time --scene-replace --scene-path=/path/to/pic --scene-width=640 --scene-height=480 -V dummy vlc://quit | |
ftp_site=foo.bar.com | |
username=user | |
passwd=password | |
ftp -in <<EOF | |
open $ftp_site | |
user $username $passwd | |
bin | |
cd /path/on/server | |
put $time.png | |
close | |
bye | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment