#!/bin/bash if [ -z $1 ]; then echo usage: $0 time chan filename [size [minvbr [maxvbr]]] exit fi cd /media/video # fucking kludge to stop problems # $1 time # $2 chan # $3 filename # $4 size 400x300 by default v4lctl setstation $2 # change to channel aumix -i90 -l90 # set volume of linein size=$4 if [ -z "$size" ]; then size='400x300' fi minvbr=$5 if [ -z "$minvbr" ]; then minvbr=3 fi maxvbr=$6 if [ -z "$maxvbr" ]; then maxvbr=$[ $minvbr + 5 ] # add 5 to min fi vbrdiff=$[ $maxvbr - $minvbr ] #nice --16 vcr -t $1 -p $2 -m stereo -F 30 -c 'DivX ;-) Low-Motion' $3 i="" start=`date +%s` end=$[ $start + ($1*60) ] dot="" while [ `date +%s` -lt $end ]; do time=$[ $end - `date +%s` ]; echo "---------------------------------------------------------------------" echo "recording $3.$i for $time seconds" if [ -n "$i" ]; then dot="."; fi nice --16 ffmpeg -y -acodec mp3 -ac 2 -r 30 -t $time -s $size \ -qmin $minvbr -qmax $maxvbr -qdiff $vbrdiff $3$dot$i i=$[i + 1] v4lctl setstation $2 # change to channel sleep 1 done