better tests

master
Marc Wäckerlin 9 years ago
parent f46fdff9c9
commit 2bb4aacc76
  1. 13
      src/convert-videos.sh

@ -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

Loading…
Cancel
Save