wenn ich mir padded ausgebe kommt nichts raus..
Code: Alles auswählen
spa=`touch --date='00:00' /tmp/spa`
fru=`touch --date='23:59:59' /tmp/fru`
for dir in `ls -d /var/cache/zoneminder/events/[Aa-Zz]*`
do
oname=$(echo $dir |cut -d/ -f6)
echo $oname
mkdir /tmp/test/${oname}
pic=$(find ${dir}/ -type d -newer /tmp/spa ! -newer /tmp/fru -printf "%p %s %AY-%Am-%Ad %TT \n" |grep /[0-9]| sort -M -k8,10 |awk '{print $1}')
for data in $pic
do
idx=00000
dat=$(ls ${data}/*.avi) #ist immer nur eine avi datei im Ordner
echo $dat
for fin in $dat
do
echo $fin /tmp/test/$oname/
echo $idx
while [[ -e /tmp/test/$oname/${padded}.avi ]]; do ((idx++)); padded="$(printf "%05d" "${idx}")"; done;
#cp $data/$fin /tmp/test/$oname/$padded.jpg
ln -s $fin /tmp/test/$oname/${padded}.avi
echo $padded
#echo $data /tmp/test/$oname/$idx.jpg
done
#ffmpeg -f image2 -i /tmp/test/$oname/%03d.jpg $oname.mpg
done
#echo $pic; exit
#for i in $pic; do echo $i; done
#echo $dir
cd /tmp/test/$oname/
ffmpeg -i %05d.avi -b 3000k ${oname}_`date -d yesterday +%F`.mpg
cp ${oname}_`date -d yesterday +%F`.mpg /var/opt/Bilder/.
done