#!/bin/bash NBFRAMES=60 INTERVAL=5 DEVICE=/dev/video0 GRABOPT="-S -o png -D 5 -i sif -d $DEVICE" TCADRE=10 CCADRE="50 30 10" if [ $# == 1 ] then JOB=$1 else JOB=piero fi export LANG=C for frame in $(seq 1 $NBFRAMES) do echo figlet -W "$NBFRAMES - $frame" negatif=/tmp/photo_${JOB}_$(printf %03d $frame).png vgrabbj $GRABOPT > $negatif sleep $INTERVAL done # export TGA_OUTILS_VERBOSE=yes for frame in $(seq 1 $NBFRAMES) do echo photo=/tmp/photo_${JOB}_$(printf %03d $frame).tga negatif=/tmp/photo_${JOB}_$(printf %03d $frame).png pngtopnm $negatif | ppmtotga -rgb -norle > $photo echo Photo = $photo tga_effects $photo updown $photo tga_effects $photo mirror $photo tga_equalize $photo square $photo tga_extract $photo $photo 10 150 620 200 # traitement de la photo dst=$(printf "/tmp/tga-$JOB-a-%03d.tga" $frame) tga_television $photo pix0 $dst 6 4 10 tga_cadre $dst sweep $dst $CCADRE $TCADRE dst=$(printf "/tmp/tga-$JOB-b-%03d.tga" $frame) tga_remap 0 $photo volcano.map $dst tga_cadre $dst sweep $dst $CCADRE $TCADRE dst=$(printf "/tmp/tga-$JOB-c-%03d.tga" $frame) tga_effects $photo water $dst 7 tga_cadre $dst sweep $dst $CCADRE $TCADRE dst=$(printf "/tmp/tga-$JOB-d-%03d.tga" $frame) tga_filtres $photo sobel $dst 1 tga_cadre $dst sweep $dst $CCADRE $TCADRE dst=$(printf "/tmp/tga-$JOB-e-%03d.tga" $frame) tga_dither $photo error $dst tga_cadre $dst sweep $dst $CCADRE $TCADRE dst=$(printf "/tmp/tga-$JOB-f-%03d.tga" $frame) tga_effects $photo x1 $dst tga_cadre $dst sweep $dst $CCADRE $TCADRE dst=$(printf "/tmp/tga-$JOB-g-%03d.tga" $frame) tga_television $photo grink $dst 0 tga_effects $dst negate $dst tga_tools message $dst 0 $dst tga_cadre $dst sweep $dst $CCADRE $TCADRE dst=$(printf "/tmp/tga-$JOB-h-%03d.tga" $frame) tga_effects $photo class0 $dst tga_cadre $dst sweep $dst $CCADRE $TCADRE dst=$(printf "/tmp/tga-$JOB-i-%03d.tga" $frame) tga_television $photo oldstyle $dst 0 100 0 tga_cadre $dst pattern $dst truchet.tga $(( TCADRE * 2 )) dst=$(printf "/tmp/tga-$JOB-j-%03d.tga" $frame) tga_applymap 1 $photo volcano.map $dst tga_cadre $dst patt_degr $dst blurp.tga $TCADRE rm $photo echo "===============================================" done figlet "almost done" echo creating GIF, please wait... set -v convert -delay 10 /tmp/tga-${JOB}-a-*.tga s3_${JOB}_a.gif convert -delay 10 /tmp/tga-${JOB}-b-*.tga s3_${JOB}_b.gif convert -delay 10 /tmp/tga-${JOB}-c-*.tga s3_${JOB}_c.gif convert -delay 10 /tmp/tga-${JOB}-d-*.tga s3_${JOB}_d.gif convert -delay 10 /tmp/tga-${JOB}-e-*.tga s3_${JOB}_e.gif convert -delay 10 /tmp/tga-${JOB}-f-*.tga s3_${JOB}_f.gif convert -delay 10 /tmp/tga-${JOB}-g-*.tga s3_${JOB}_g.gif convert -delay 10 /tmp/tga-${JOB}-h-*.tga s3_${JOB}_h.gif convert -delay 10 /tmp/tga-${JOB}-i-*.tga s3_${JOB}_i.gif convert -delay 10 /tmp/tga-${JOB}-j-*.tga s3_${JOB}_j.gif