From: Steven Baltakatei Sandoval Date: Sat, 12 Jun 2021 21:53:21 +0000 (+0000) Subject: update(unitproc:bkvideo2webm):Rename, add example X-Git-Tag: 0.4.6^2 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/b2fc770c0dc241d3e7bdf409f443a9fbeb5fe141?hp=c5981ead1bc78d2845bdc1e32df3b57994b7ae62 update(unitproc:bkvideo2webm):Rename, add example --- diff --git a/unitproc/bkvideo2webm b/unitproc/bkvideo2webm new file mode 100755 index 0000000..41e9e29 --- /dev/null +++ b/unitproc/bkvideo2webm @@ -0,0 +1,19 @@ +#/bin/bash +# Desc: Convert video file to webm +# Usage: bkvideo2webm.sh [ file ] +# Example: +# $ for file in ./*; do bkvideo2webm "$file"; done; +# Ref/Attrib: Geert Van Pamel, original author; date accessed: 2021-06-12; url: https://commons.wikimedia.org/wiki/Help:Converting_video +# Version 0.1.2 +# Depends: ffmpeg version 4.1.6-1 (see https://tracker.debian.org/pkg/ffmpeg ) + +# Parameters: +# P1: input file name + +if [[ -z "$1" ]]; then echo "Input file missing"; exit; fi; + +input="$1"; +output=$(basename "$1").webm + +ffmpeg -i "$input" -c:v libvpx-vp9 -b:v 0 -crf 30 -pass 1 -row-mt 1 -an -f webm -y /dev/null; +ffmpeg -i "$input" -c:v libvpx-vp9 -b:v 0 -crf 30 -pass 2 -row-mt 1 -c:a libopus "$output";