Skip to content

Instantly share code, notes, and snippets.

@jamjon3
Created April 29, 2014 15:01
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 jamjon3/11402937 to your computer and use it in GitHub Desktop.
Save jamjon3/11402937 to your computer and use it in GitHub Desktop.
This script converts several video files to royalty free WEBM
#!/bin/bash
VIDEOS=~/Videos/WCW/1/
find "$VIDEOS" -name '*.MP4' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.MP4}.webm"' {} \;
find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.mp4}.webm"' {} \;
find "$VIDEOS" -name '*.MPG' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.MPG}.webm"' {} \;
find "$VIDEOS" -name '*.mpg' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.mpg}.webm"' {} \;
find "$VIDEOS" -name '*.MOV' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.MOV}.webm"' {} \;
find "$VIDEOS" -name '*.mov' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.mov}.webm"' {} \;
find "$VIDEOS" -name '*.DV' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.DV}.webm"' {} \;
find "$VIDEOS" -name '*.dv' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.dv}.webm"' {} \;
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment