Capture Batch Script updated

Looking back the other day at this post, I remembered that it had somehow stopped working on the eeepc. I suspected this had something to do with vlc and was always bothered anyway about using such a big, fully-featured programme in non-gui mode for such a simple task. Breaking a butterfly upon a wheel and other such sayings.

Searching for something completely different i.e. some information about python graphical libraries, I came upon this page and downloaded ‘streamer’ from the repositories. It was just what I needed. I thoroughly recommend it for such tasks as quickly grabbing images at periodic intervals from a web cam (as experimented with during my Going Solo residency). In the spirit of sharing, here’s the updated script I call from a cron job (see earlier post for details about this)

#!/bin/bash

cd $HOME/captures

D1=`date +%Y-%m-%d`
D2=`date +%Y%m%d_%H-%M-%S`

# If the date directory does not exist, create it
if [ ! -d $D1 ] ; then
mkdir -p $D1
fi

#cd to this new directory
cd $HOME/captures/$D1

# capture with streamer
streamer -c /dev/video0 -o $D2.jpeg
This entry was posted in Bash scripting, Linux, Software, Webcam and tagged , , . Bookmark the permalink.