diff --git a/videos/transcode.sh b/videos/transcode.sh new file mode 100755 index 0000000..f361b6c --- /dev/null +++ b/videos/transcode.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +if [[ ! -f "ffmpeg2pass-0.log" ]]; then + videoToConvert=$(ls -tr | grep -E '^.{4}\.' | grep -v xml | head -1) + if [ ! -z "$videoToConvert" ]; then + + nameWithoutExtension=$(echo $videoToConvert | sed 's/\..*//') + + ffmpeg -i $videoToConvert -c:v libvpx-vp9 -b:v 0 -crf 10 -pass 1 -an -f null /dev/null && \ + ffmpeg -i $videoToConvert -c:v libvpx-vp9 -b:v 0 -crf 10 -pass 2 -c:a libopus transcoding-$nameWithoutExtension.webm + + mv transcoding-$nameWithoutExtension.webm c$nameWithoutExtension.webm + + editedXML=$(sed 's/\(