Code:
#!/bin/bash
# creo lista
find . -type f -name "*.mp4" > filesmp4.txt
# conto righe file
righe=$(wc -l filesmp4.txt | awk '{print $1}')
riga=0
# ciclo di elaborazione
while [ $riga -lt $righe ]; do
let riga+=1
current=$(head -$riga filesmp4.txt | tail -1)
#echo $current
# creo thumbs
ffmpeg -i "$current" -vframes 1 "$current.jpg"
done
# confronto files
find . -type f -name "*.jpg" > filesjpg.txt
righejpg=$(wc -l filesjpg.txt | awk '{print $1}')
echo $righejpg " THUMBS"
echo $righe " righe"
# cancellazione liste
rm *.txt
echo FINE