Tuesday, 30 July 2013

How to use bash to capture webcam image and upload it to dropbox.

How to Take a photo with bash!

1) install fswebcam 
sudo apt-get install fswebcam -y

2) install dropbox uploader
sudo git clone https://github.com/andreafabrizi/Dropbox-Uploader/
cd Dropbox-Uploader
chmod 777 *.*

3) setup dropbox uploader
./dropbox_uploader.sh info
Follow on screen instructions

4) create the capture file and uploader
sudo nano cam.sh

put the following in the file

filename=$(date +"%m-%d-%y|||%H%M%S")
fswebcam -r 356x292 -d /dev/video0 $filename.jpg

./dropbox_uploader.sh upload $filename.jpg

5) save and exit and then chmod 777 cam.sh

6) type ./camsh and then check dropbox and your done.

No comments:

Post a Comment



Donate Towards More Raspberry PI's for Projects