Skip to content

Instantly share code, notes, and snippets.

@davedarko
Created February 5, 2012 11:26
Show Gist options
  • Save davedarko/1744862 to your computer and use it in GitHub Desktop.
Save davedarko/1744862 to your computer and use it in GitHub Desktop.
24h Webcam Script
#!/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