From f6a262ff79b3c2f823ce6ee05d6f86ce0a3edec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Sun, 29 Mar 2015 15:13:33 +0000 Subject: [PATCH] added conversion to x.264 mp4 --- src/tomp4.sh | 21 +++++++++++++++++++++ src/towebm.sh | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 src/tomp4.sh diff --git a/src/tomp4.sh b/src/tomp4.sh new file mode 100755 index 0000000..589c493 --- /dev/null +++ b/src/tomp4.sh @@ -0,0 +1,21 @@ +#! /bin/bash -ex + +SRC=${1:-.} +DST=${2:-/var/tmp/spielfilme/mp4} + +for f in $(find "$SRC" \( \( -name '.??*' -o -name '*.jpg' \) -prune \) -o -type f -print); do + t="${f/$SRC/$DST}" + t="${t%.*}.mp4" + if test -s "${t}"; then + continue; + fi + if ( ! test -s "${t}" ) && ( test -e "$t" ); then + rm "$t" + fi + test -d "${t%/*}" || mkdir -p "${t%/*}" + #avconv -i "$f" -vcodec libx264 -deinterlace -acodec libvo_aacenc "$t" + avconv -i "$f" -vcodec libx264 -acodec aac -strict experimental -deinterlace "$t" + if ( ! test -s "${t}" ) && ( test -e "$t" ); then + rm "$t" + fi +done diff --git a/src/towebm.sh b/src/towebm.sh index 2626cea..73d90f6 100755 --- a/src/towebm.sh +++ b/src/towebm.sh @@ -1,7 +1,7 @@ #! /bin/bash -SRC="/var/data/spielfilme" -DST="/var/tmp/spielfilme/webm" +SRC=${1:-.} +DST=${2:-/var/tmp/spielfilme/webm} for f in $(find "$SRC" \( -name '*.jpg' -prune \) -o -type f -print); do t="${f/$SRC/$DST}" @@ -11,7 +11,7 @@ for f in $(find "$SRC" \( -name '*.jpg' -prune \) -o -type f -print); do fi test -d "${t%/*}" || mkdir -p "${t%/*}" #ffmpeg -i "$f" -b 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 "$t" - avconv -i "$f" "$t" + avconv -i "$f" -vcodec libvpx -acodec libvorbis -f webm -g 30 "$t" if ( ! test -s "${t}" ) && ( test -e "$t" ); then rm "$t" fi