Skip to content

Instantly share code, notes, and snippets.

@starikcetin
Created September 3, 2023 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save starikcetin/a7839f6f0a2855b217be5b4556d12919 to your computer and use it in GitHub Desktop.
Save starikcetin/a7839f6f0a2855b217be5b4556d12919 to your computer and use it in GitHub Desktop.
#!/bin/bash
shopt -s globstar
FILES=(./**/*.*)
TOTAL_COUNT=${#FILES[@]}
CURRENT_COUNT=1
for i in "${FILES[@]}"; do
echo "processing (${CURRENT_COUNT} of ${TOTAL_COUNT}) ${i}"
ffmpeg -hide_banner -loglevel error -stats -i "$i" -c:v libvpx-vp9 -crf 18 -deadline good -cpu-used 0 -an "${i%.*}__optimized.webm"
CURRENT_COUNT=$((CURRENT_COUNT+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment