20 lines
561 B
Bash
Executable file
20 lines
561 B
Bash
Executable file
#!/bin/bash
|
|
# make_thumbs v0.0.2
|
|
# Script que genera thumbnails de todas las películas en el directorio Media
|
|
# Copyright Santi Noreña 2012-2013
|
|
# GPL License
|
|
cd $0 ||{
|
|
echo "Can not change to directory." $0
|
|
exit $E_XCD;
|
|
}
|
|
for folder in $(find -maxdepth 1 -type d); do
|
|
rm $folder/thumbs/*
|
|
mkdir $folder/thumbs
|
|
done
|
|
for file in $(find . -maxdepth 2 -mindepth 2 -type f ); do
|
|
avconv -i $file -f image2 -frames:v 1 -s 64x46 -vcodec mjpeg $file.jpg
|
|
done
|
|
for folder in $(find -maxdepth 1 -type d); do
|
|
mv $folder/*.jpg $folder/thumbs
|
|
done
|
|
exit 0
|