From 3279d120bf60dea64a65f822cb54e755e0c7acf2 Mon Sep 17 00:00:00 2001 From: tonton Th Date: Fri, 29 Nov 2019 20:40:29 +0100 Subject: [PATCH] shoot.sh was added --- scripts/shoot.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 scripts/shoot.sh diff --git a/scripts/shoot.sh b/scripts/shoot.sh new file mode 100755 index 00000000..d1b24ec6 --- /dev/null +++ b/scripts/shoot.sh @@ -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 + +