summaryrefslogtreecommitdiff
path: root/files/convert-mp4-to-webm.sh
diff options
context:
space:
mode:
Diffstat (limited to 'files/convert-mp4-to-webm.sh')
-rw-r--r--files/convert-mp4-to-webm.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/files/convert-mp4-to-webm.sh b/files/convert-mp4-to-webm.sh
new file mode 100644
index 0000000..5fd56e1
--- /dev/null
+++ b/files/convert-mp4-to-webm.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+SOURCE_DIR="."
+OUTPUT_PREFIX="video"
+COUNT=1
+
+mkdir -p webm_output &>/dev/null
+
+for FILE in "${SOURCE_DIR}"/*.mp4; do
+ OUTPUT_FILE="webm_output/${OUTPUT_PREFIX}${COUNT}.webm"
+ printf "%s\n" "[inf] processing ${FILE} -> ${OUTPUT_FILE}"
+ ffmpeg -i "${FILE}" -an -c:v libvpx-vp9 -crf 32 -b:v 0 -vf "scale=1920:1080,fps=24" -threads 4 -speed 3 -g 48 "${OUTPUT_FILE}"
+
+ ((COUNT++))
+done
+
+printf "%s\n" "[inf] all videos converted to optimized .webm format in ./webm_output/"