Skip to content

Instantly share code, notes, and snippets.

@stammy
Created February 9, 2014 07:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stammy/8895507 to your computer and use it in GitHub Desktop.
Save stammy/8895507 to your computer and use it in GitHub Desktop.
#!/bin/bash
VIDEOS=~/Dropbox/_vid
find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 3000k -f webm -vf scale=-1:720 -bufsize 1500k -quality good -cpu-used 0 -qmin 10 -qmax 42 -c:a libvorbis -threads 8 "${0%%.mp4}.webm"' {} \;
find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -vf scale=-1:720 -quality good -cpu-used 0 -threads 8 "${0%%.mp4}_720p.mp4"' {} \;
# square video
#find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -c:v libvpx -crf 10 -b:v 3000k -f webm -aspect 1 -vf "scale=-1:720, crop=720:720" -bufsize 1500k -quality good -cpu-used 0 -qmin 10 -qmax 42 -c:a libvorbis -threads 8 "${0%%.mp4}.webm"' {} \;
#find "$VIDEOS" -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -aspect 1 -vf "scale=-1:720, crop=720:720" -quality good -cpu-used 0 -threads 8 "${0%%.mp4}_720p.mp4"' {} \;
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment