diff options
-rwxr-xr-x | aencode.sh | 6 | ||||
-rwxr-xr-x | vencode.sh | 8 |
2 files changed, 7 insertions, 7 deletions
@@ -17,9 +17,9 @@ for d in bgm sfx; do pushd $(dirname $0)/www/dump/${d} for f in *.ogg; do OUT=${f%.ogg} - ffmpeg -y -i $f -c:a pcm_s16le ${OUT}.wav - opusenc --bitrate 64 ${OUT}.wav ${OUT}.opus - ffmpeg -n -i ${OUT}.wav -c:a libfdk_aac -vbr 2 ${OUT}.m4a || true + [[ -f ${OUT}.wav ]] || ffmpeg -i $f -c:a pcm_s16le ${OUT}.wav + [[ -f ${OUT}.opus ]] || opusenc --bitrate 64 ${OUT}.wav ${OUT}.opus + [[ -f ${OUT}.m4a ]] || ffmpeg -i ${OUT}.wav -c:a libfdk_aac -vbr 2 ${OUT}.m4a done popd done @@ -11,13 +11,13 @@ cd $(dirname $0)/www/dump/video ffmpeg() { set -x - command ${FFMPEG} -n -threads ${THREADS} ${FFMPEG_FLAGS} "$@" + command ${FFMPEG} -threads ${THREADS} ${FFMPEG_FLAGS} "$@" set +x } for f in *.mkv; do OUT=${f%.mkv} - ffmpeg -i $f -c:v libx264 -preset slower -tune animation -c:a libfdk_aac ${OUT}.mp4 - ffmpeg -i $f -c:v libvpx -crf 15 -b:v 1M -c:a copy ${OUT}.webm - ffmpeg -i $f -c:v libtheora -qscale:v 6 -c:a copy ${OUT}.ogv + [[ -f ${OUT}.mp4 ]] || ffmpeg -i $f -c:v libx264 -preset slower -tune animation -c:a libfdk_aac ${OUT}.mp4 + [[ -f ${OUT}.webm ]] || ffmpeg -i $f -c:v libvpx -crf 15 -b:v 1M -c:a copy ${OUT}.webm + [[ -f ${OUT}.ogv ]] || ffmpeg -i $f -c:v libtheora -qscale:v 6 -c:a copy ${OUT}.ogv done |