Created
August 21, 2017 16:21
-
-
Save cleverdevil/9bfe959eb2311ea1c0195c96b2db5e90 to your computer and use it in GitHub Desktop.
Convert an arbitrary video to HTML5 compatible formats and output the HTML needed to embed the video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ffmpeg -i $1 -b:v 1500k -vcodec libx264 -g 30 html5-$1.mp4 &>/dev/null | |
ffmpeg -i $1 -b:v 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 html5-$1.webm &>/dev/null | |
ffmpeg -i $1 -b:v 1500k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 html5-$1.ogv &>/dev/null | |
echo "<video controls>" | |
echo " <source src=\"html5-$1.mp4\" type=\"video/mp4\">" | |
echo " <source src=\"html5-$1.webm\" type=\"video/webm\">" | |
echo " <source src=\"html5-$1.ogg\" type=\"video/ogg\">" | |
echo "</video>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment