added conversion to x.264 mp4

This commit is contained in:
Marc Wäckerlin
2015-03-29 15:13:33 +00:00
parent 7aef0d2805
commit f6a262ff79
2 changed files with 24 additions and 3 deletions

21
src/tomp4.sh Executable file
View File

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

View File

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