Skip to content

Instantly share code, notes, and snippets.

@mrpollo
Created September 26, 2012 21:16
Show Gist options
  • Select an option

  • Save mrpollo/3790637 to your computer and use it in GitHub Desktop.

Select an option

Save mrpollo/3790637 to your computer and use it in GitHub Desktop.
Convert to video HTML5
#!/bin/bash
ffmpeg=/usr/local/bin/ffmpeg
for f in *.mp4
do
echo "Converting $f into webm"
$ffmpeg -i "$f" -b 1500k -vcodec libvpx -acodec libvorbis -ab 55000 -f webm -g 30 -s 1280x720 "$f".webm
echo "Converting $f into ogv"
$ffmpeg -i "$f" -b 1500k -vcodec libtheora -acodec libvorbis -ab 55000 -g 30 -s 1280x720 "$f".ogv
echo "Converting $f into mp4"
$ffmpeg -i "$f" -b 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 -s 1280x720 "$f".1280_720.mp4
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment