summaryrefslogtreecommitdiff
path: root/aencode.sh
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-09-02 10:02:40 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-09-02 10:02:40 -0400
commit74b0fee0c2c5eabb9529481b41cc6581892119ea (patch)
tree0ef2ca351d4b755d0e3af13bf91b4ba58e1d73fd /aencode.sh
parentfafc904d0e8b5a76577f16700c123af684176fdc (diff)
downloadhtml5ks-74b0fee0c2c5eabb9529481b41cc6581892119ea.tar.xz
html5ks-74b0fee0c2c5eabb9529481b41cc6581892119ea.zip
Add aencode.sh for Opus and AAC.
Diffstat (limited to 'aencode.sh')
-rwxr-xr-xaencode.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/aencode.sh b/aencode.sh
new file mode 100755
index 0000000..63ad918
--- /dev/null
+++ b/aencode.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# configure ffmpeg location if not in PATH
+FFMPEG=ffmpeg
+# configure flags
+FFMPEG_FLAGS=""
+
+set -e
+
+aencode() {
+ set -x
+ [[ -f $4 ]] || ${FFMPEG} -threads ${THREADS} -i "$1" -c:a "$2" $3 ${FFMPEG_FLAGS} "$4"
+}
+
+for d in bgm sfx; do
+ cd $(dirname $0)/www/dump/${d}
+ for f in *.ogg; do
+ OUT=${f%.ogg}
+ aencode $f libopus "-b:a 48k -vbr on" ${OUT}.opus
+ aencode $f libfdk_aac -vbr 2 ${OUT}.m4a
+ done
+done