Skip to content

Instantly share code, notes, and snippets.

@pwaldhauer
Created September 15, 2014 15:45
Show Gist options
  • Save pwaldhauer/da916a64c5794304da0c to your computer and use it in GitHub Desktop.
Save pwaldhauer/da916a64c5794304da0c to your computer and use it in GitHub Desktop.
Create HTML5 <video> tag-ready videos and a poster screenshot.
#!/bin/bash
echo "MP4"
#ffmpeg -i $1 -vcodec libx264 -vprofile slow -vprofile baseline -b:v 1500k -b:a 64k -g 30 $1.mp4
ffmpeg -i $1 -vcodec libx264 -vprofile slow -vprofile baseline -b:v 1500k -an -g 30 $1.mp4
echo "webm (VP8 / Vorbis)"
#ffmpeg -i $1 -b:v 1500k -b:a 64k -vcodec libvpx -acodec libvorbis -f webm -g 30 $1.webm
ffmpeg -i $1 -b:v 1500k -b:a 64k -vcodec libvpx -an -f webm -g 30 $1.webm
echo "ogv (Theora / Vorbis)"
#ffmpeg -i $1 -b:v 1500k -b:a 64k -vcodec libtheora -acodec libvorbis -g 30 $1.ogv
ffmpeg -i $1 -b:v 1500k -b:a 64k -vcodec libtheora -an -g 30 $1.ogv
echo "jpeg"
ffmpeg -i $1 -vframes 1 -r 1 -f image2 $1.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment