From 31ec32d4b429ecf3aac2c947b9dfb2bbff35de33 Mon Sep 17 00:00:00 2001 From: heqnx Date: Sun, 6 Jul 2025 17:05:57 +0300 Subject: added a conversion script and small typos --- files/convert-mp4-to-webm.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 files/convert-mp4-to-webm.sh (limited to 'files') 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/" -- cgit v1.2.3