Get a Free Trial

Convert Online Video's to Animated GIF's with Node.js

DownloadTechnical Information
Node.js API

Use GrabzIt's Node.js API to convert online videos into animated GIF's. However you must remember that for any of the below examples to create a animated GIF the save or save_to method must be called after the url_to_animation method.

Basic Options

The only parameter that is required is the URL of the MP4, AVI or other online video to convert into an animated GIF to the url_to_animation method.

client.url_to_animation("http://www.example.com/video.avi");
//Then call the save or save_to method

Convert Vimeo or YouTube Video to Animated GIF

Convert Vimeo or YouTube video's directly to animated GIF's with GrabzIt's Node.js API, just specify the URL of the page that the Vimeo or YouTube video appears on and the video it contains will be converted into an animated GIF. However because this service relies on a third-party website it can not be guaranteed to work for every video.

client.url_to_animation("https://www.youtube.com/watch?v=a1Y73sPHKxw");
//Then call the save or save_to method

Custom Identifier

You can pass a custom identifier to the url_to_animation method as shown below, this value is then passed back to your GrabzIt Node.js handler. For instance this custom identifier could be a database identifier, allowing a animated GIF to be associated with a particular database record.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"customId":123456};
client.url_to_animation("https://www.youtube.com/watch?v=a1Y73sPHKxw", options);
//Then call the save method
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});

Capture a Single Frame from a Video

Capture a single frame from a video you need to set the duration and the frames per second parameters to be 1. You can then get your required frame by setting the start position parameter.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"start":3, "duration":1, "framesPerSecond":1};
client.url_to_animation("http://www.example.com/video.avi", options);
//Then call the save or save_to method
client.save_to("result.gif", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});