GrabzIt
Tools to Capture and Convert the Web

Convert Vimeo and YouTube Videos to GIF's with JavaScriptJavaScript API

A common request from webmasters is how to easily show a video preview without loading a video. The common way to achieve this is by converting a video into an animated GIF and then displaying it on your website. GrabzIt's JavaScript API makes this simple.

Convert YouTube Video to Animated GIF

Below is an example of how to convert a YouTube video into an animated GIF, its important to note that the YouTube video URL has been URL encoded to ensure that it is not mangled when transmited to GrabzIt. However there are many more options you can use to customize your animated GIF, for instance the size of the GIF could be changed, the duration of the animation, the frames per second or even a custom watermark overlayed.

<script src="grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("https://www.youtube.com/watch?v=7GqClqvlObY", 
{"format": "gif"}).Create();
</script>

Convert Vimeo Video to Animated GIF

GrabzIt can also convert Vimeo videos into animated GIFs, in exactly the same way that it converts YouTube videos. Just pass the URL of the web page that contains the Vimeo video, to the url parameter and pass "gif" to the format parameter as shown below.

<script src="grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("https://vimeo.com/134957666", 
{"format": "gif"}).Create();
</script>

Finally GrabzIt can also convert normal online videos such as a MP4 video. Simply pass the URL of the video to the url parameter, while setting the format parameter to "gif" in the same way as above.