Skip to content

Instantly share code, notes, and snippets.

@shuklaneerajdev
Forked from samuelcolvin/videojs_encoding.sh
Last active March 23, 2018 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shuklaneerajdev/b4a9f43b500172e62f5a1c6f593ba34c to your computer and use it in GitHub Desktop.
Save shuklaneerajdev/b4a9f43b500172e62f5a1c6f593ba34c to your computer and use it in GitHub Desktop.
<video id="into-video" class="video-js vjs-default-skin" autoplay controls preload="auto" width="640"
poster="https://mycdn.cloudfront.net/myposter.png">
<source src="https://mycdn.cloudfront.net/video.webm" type='video/webm' />
<source src="https://mycdn.cloudfront.net/video.mp4" type='video/mp4' />
<p class="vjs-no-js">To view this video please enable JavaScript, or consider upgrading your browser.</p>
</video>
# example video encoding for vidoe.js
# for the mp4 video you need aac installed, on Ubuntu:
sudo apt-get install libfaac0
# you seem to need two files for video js, a webm file and an mp4 file
# using ffmpeg these can be generated hence, assuming you start from a .mov file.
ffmpeg -i video.mov -codec:a aac -strict -2 -codec:v h264 -b:a 128k -b:v 1200k -flags +aic+mv4 video.mp4
ffmpeg -i video.mov -codec:a libvorbis -codec:v libvpx -b:a 128k -b:v 1200k video.webm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment