Skip to content

Instantly share code, notes, and snippets.

@jamjon3
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jamjon3/f7a00f2826aaa76cb601 to your computer and use it in GitHub Desktop.
Save jamjon3/f7a00f2826aaa76cb601 to your computer and use it in GitHub Desktop.
This script converts several video files to royalty free WEBM (using avconv)
#!/bin/bash
VIDEOS=~/Desktop/Wedding/
find "$VIDEOS" -name '*.mp4' -exec sh -c 'avconv -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.mp4}.webm"' {} \;
find "$VIDEOS" -name '*.mkv' -exec sh -c 'avconv -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.mkv}.webm"' {} \;
find "$VIDEOS" -name '*.avi' -exec sh -c 'avconv -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.avi}.webm"' {} \;
find "$VIDEOS" -name '*.AVI' -exec sh -c 'avconv -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.AVI}.webm"' {} \;
find "$VIDEOS" -name '*.MPG' -exec sh -c 'avconv -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.MPG}.webm"' {} \;
find "$VIDEOS" -name '*.wmv' -exec sh -c 'avconv -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.wmv}.webm"' {} \;
find "$VIDEOS" -name '*.MOV' -exec sh -c 'avconv -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.MOV}.webm"' {} \;
find "$VIDEOS" -name '*.mov' -exec sh -c 'avconv -i "$0" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis "${0%%.mov}.webm"' {} \;
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment