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. 그러나이 서비스는 타사 웹 사이트를 사용하므로 모든 비디오에서 작동한다고 보장 할 수는 없습니다.
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로 설정해야하는 비디오에서 단일 프레임을 캡처하십시오. 그런 다음 시작 위치 매개 변수를 설정하여 필요한 프레임을 얻을 수 있습니다.
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; } });