Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save am11/7103164 to your computer and use it in GitHub Desktop.
Save am11/7103164 to your computer and use it in GitHub Desktop.
Convert video files for HTML5 with FFMPEG :: Windows and Linux
/* Starting with avi file "moh.avi" .. could be any video format */
ffmpeg -i moh.avi -b 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 moh.mp4 // IE, Opera, Chrome, Safari
(OR)
ffmpeg -i moh.avi -b 1500k -ab 128k -ac 2 -vcodec libx264 -preset slow -crf 22 -threads 0 -profile:v main moh.avi
ffmpeg -i moh.avi -b 1500k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 moh.ogv // Firefox
ffmpeg -i moh.avi -b 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 moh.webm // Chrome
/* Poster image */
ffmpeg -i moh.avi -r 1 -f image2 image-%3d.jpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment