GrabzItのNode.js API オンライン動画を変換する intoアニメーションGIF。 ただし、以下の例のいずれかでアニメーションGIFを作成するには、 save or save_to メソッドは url_to_animation 方法。
必要なパラメーターは、MP4、AVI、または変換する他のオンラインビデオのURLのみです intoアニメーションGIFを url_to_animation
方法。
client.url_to_animation("http://www.example.com/video.avi"); //Then call the save or save_to method
GrabzItのNode.js APIを使用して、VimeoまたはYouTubeビデオを直接アニメーションGIFに変換します。VimeoまたはYouTubeビデオが表示されるページのURLを指定するだけで、含まれるビデオが変換されます。 intoアニメーションGIF。 ただし、このサービスはサードパーティのWebサイトに依存しているため、すべての動画で機能することを保証することはできません。
client.url_to_animation("https://www.youtube.com/watch?v=a1Y73sPHKxw"); //Then call the save or save_to method
にカスタム識別子を渡すことができます url_to_animation メソッドを以下に示すように、この値はGrabzIt Node.jsハンドラーに返されます。 たとえば、このカスタム識別子はデータベース識別子であり、アニメーションGIFを特定のデータベースレコードに関連付けることができます。
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; } });
継続時間と1秒あたりのフレーム数パラメーターを1に設定する必要があるビデオから単一のフレームをキャプチャします。 その後、開始位置パラメーターを設定して、必要なフレームを取得できます。
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; } });