montageVideos.sh 438 B

1234567
  1. #/bin/bash
  2. if [ -d .snapshots ]; then rm -Rf .snapshots; fi
  3. mkdir -p .snapshots
  4. for f in *.*; do input=$f; ffmpeg -ss $(bc -l <<< $(ffprobe -loglevel error -of csv=p=0 -show_entries format=duration $input)*0.5) -i $input -frames:v 1 .snapshots/$input; done
  5. montage -verbose -label %f -pointsize 10 -background '#000000' -fill 'gray' -define jpeg:size=300x300 -geometry 300x300+4+4 -auto-orient .snapshots/*.* output.png
  6. rm -rf .snapshots