#!/bin/sh
# Steven Shiau <steven@nchc.org.tw>

target=$1
USAGE="Usage: $0 prefix"
# size unit is MB
size="15000"

# the output format, we do not want the format from "--timestamp"...
#gr2003.09.22_18-03-09.dv
#DATE=`date +%F | sed -e 's/-/./g'`
DATE=`date +%F`
TIME=`date +%T | sed -e 's/:/-/g'`
TIME_STAMP="${DATE}_${TIME}"

target_fn="${target}-${TIME_STAMP}-"
echo "filename prefix: $target_fn"
if [ $# -ne 1 ]; then
   echo "$USAGE"
   echo "Example: "
   echo "$0 dv"
   echo "It will capture the video and sound to dv-${TIME_STAMP}.dv."
   exit 1
fi

dvgrab --format raw --size $size $target_fn

