વાપરવુ GrabzIt ની Node.js API videosનલાઇન વિડિઓ કન્વર્ટ કરવા માટે into એનિમેટેડ GIF ની. જો કે તમારે એ યાદ રાખવું આવશ્યક છે કે એનિમેટેડ GIF બનાવવા માટે નીચેના કોઈપણ ઉદાહરણો માટે save or save_to પદ્ધતિ પછી કહેવાવી જ જોઇએ url_to_animation પદ્ધતિ
એકમાત્ર પરિમાણ જરૂરી છે કે કન્વર્ટ કરવા માટે MP4, AVI અથવા અન્ય videoનલાઇન વિડિઓનો URL છે intમાટે એનિમેટેડ GIF url_to_animation
પદ્ધતિ
client.url_to_animation("http://www.example.com/video.avi"); //Then call the save or save_to method
Vimeo અથવા YouTube વિડિઓને GrabzIt ના Node.js API સાથે એનિમેટેડ GIF ના સીધા રૂપાંતરિત કરો, ફક્ત પૃષ્ઠનો URL સ્પષ્ટ કરો કે જે Vimeo અથવા YouTube વિડિઓ પર દેખાય છે અને તેમાં શામેલ વિડિઓ કન્વર્ટ થઈ જશે intએક એનિમેટેડ 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; } });