diff --git a/src/toogg.sh b/src/toogg.sh new file mode 100755 index 0000000..01ebffc --- /dev/null +++ b/src/toogg.sh @@ -0,0 +1,17 @@ +#! /bin/bash + +SRC=${1:-.} +DST=${2:-/var/tmp/spielfilme/ogg} + +for f in $(find "$SRC" \( -name '*.jpg' -prune \) -o -type f -print); do + t="${f/$SRC/$DST}" + t="${t%.*}.ogg" + if test -s "${t}"; then + continue; + fi + test -d "${t%/*}" || mkdir -p "${t%/*}" + avconv -i "$f" -c:v libtheora -c:a libvorbis -q:v 6 -q:a 5 "$t" + if ( ! test -s "${t}" ) && ( test -e "$t" ); then + rm "$t" + fi +done