Compare commits

..

2 Commits

Author SHA1 Message Date
tonton Th
9e4b0e795c Merge branch 'master' of ssh://tetalab.org:2213/tTh/FloatImg
Ok
2019-12-04 11:29:19 +01:00
tonton Th
3279d120bf shoot.sh was added 2019-11-29 20:40:29 +01:00

53
scripts/shoot.sh Executable file
View File

@ -0,0 +1,53 @@
#!/bin/bash
GVS=${HOME}/Devel/FloatImg/v4l2/grabvidseq
# ------------------------------------
# set some default values
DEV=/dev/video2
SZ=640x480
NBRE=320
PERIOD=0.0
COUNT=compteur
OPTIONS=" -u"
# ------------------------------------
# overide parameters from $PWD
if [ -r ./reglages ]
then
source ./reglages
fi
# ------------------------------------
# get the current picture number
if [ -r $COUNT ]
then
numero=$( head -1 $COUNT )
else
numero=1
fi
# ------------------------------------
# make the output filename
if [ 1 -eq $# ]
then
outfile="$1"
else
outfile=$( printf "P_%04d.pnm" $numero )
fi
# ------------------------------------
# take and display the fancy picture
$GVS -d $DEV -n $NBRE -p $PERIOD $OPTIONS -s $SZ -o $outfile
if [ ${SHOW} == "yes" ]
then
display $outfile &
fi
# ------------------------------------
# increment and save the picture number
numero=$(( numero + 1 ))
echo $numero > $COUNT