Skip to content

Instantly share code, notes, and snippets.

@jefftriplett
Created January 12, 2011 16:41
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 jefftriplett/776425 to your computer and use it in GitHub Desktop.
Save jefftriplett/776425 to your computer and use it in GitHub Desktop.
various video encoding settings
#!/bin/bash
# via: http://johndyer.name/post/ffmpeg-Settings-for-HTML5-h264-mp4-theora-ogg-vp8-webm.aspx
#
# Also, noteworthy for actually displaying said videos:
# http://mediaelementjs.com/
# mp4 (H.264 / ACC)
ffmpeg -i %1 -b 1500k -vcodec libx264 -vpre slow -vpre baseline \
-g 30 -s 640x360 %1.mp4
# webm (VP8 / Vorbis)
ffmpeg -i %1 -b 1500k -vcodec libvpx \
-acodec libvorbis -ab 160000 -f webm \
-g 30 -s 640x360 %1.webm
# ogv (Theora / Vorbis)
ffmpeg -i %1 -b 1500k -vcodec libtheora \
-acodec libvorbis -ab 160000 \
-g 30 -s 640x360 %1.ogv
# jpeg (screenshot at 10 seconds)
ffmpeg -i %1 -ss 00:10 -vframes 1 -r 1 -s 640x360 -f image2 %1.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment