Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Service to convert video to gif via api [closed]

I've been using Zencoder's api to convert videos from one format to another but I now need to convert a video to an animated gif which is not included in the output formats on Zencoder.

Anyone know of a service which is able to do this, or alternatively any relatively simple backend library ideally php based which could do this?

like image 921
user1803975 Avatar asked Nov 07 '12 11:11

user1803975


1 Answers

I think due to the difficulty of making such a web service (API) work efficiently at scale there are very few providers offering the functionality of automating Video to GIF conversion via a REST API.

However, I found myself in a similar situation recently, did some research and came across two API products that might do the job for you:

  1. giflayer API

    This one's a REST API dedicated to converting videos to GIF animations. It works for both video URLs to portals like YouTube, and direct video links like http://website.com/video.mp4.

    Here's how you make an API request:

    https://apilayer.net/api/capture
       ? access_key = YOUR_ACCESS_KEY
       & url = https://www.youtube.com/watch?v=3W6hZR29l5o
       & start = 170
       & duration = 1.5  
    


    Then, after a few seconds the API directly returns your GIF animation according to the parameters supplied in the request:

    enter image description here


That's that, now there's also a second service that might fit the requirements stated above:

  1. gfycat

    While they don't create actual GIFs, they supplement them by converting to HTML5 video, which is more lightweight in size. Just including this link if you're not yet sure whether it's actual GIF conversion you need.

Hope I could help.

like image 171
Rocket Science Avatar answered Nov 05 '22 12:11

Rocket Science