better tests

This commit is contained in:
Marc Wäckerlin
2015-03-31 13:59:17 +00:00
parent f46fdff9c9
commit 2bb4aacc76

View File

@@ -11,19 +11,18 @@ FLAGS["mp4"]="-vcodec libx264 -acodec aac -strict experimental -crf 19"
for f in $(find "$SRC" \( \( -name '.??*' -o -name '*.jpg' \) -prune \) -o -type f -print); do
for format in ${FORMATS}; do
t="${f/$SRC/$DST/${format}}"
t="${t%.*}.${f}"
if test -s "${t}"; then
continue;
continue; # ignore if file exists and is not empty
fi
if ( ! test -s "${t}" ) && ( test -e "$t" ); then
rm "$t"
if test -e "$t"; then
rm "$t"; # remove existing empty file
fi
test -d "${t%/*}" || mkdir -p "${t%/*}"
avconv -i "$f" ${FLAGS[$f]} -filter:v yadif "$t"
if ( ! test -s "${t}" ) && ( test -e "$t" ); then
rm "$t"
if ( ! avconv -i "$f" ${FLAGS[$f]} -filter:v yadif "$t"
|| ! test -s "${t}") && test -e "$t"; then
rm "$t"; # remove file if conversion failed
fi
done
done