5
前端实现视频转gif图片
source link: https://xushanxiang.com/video2gif.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前端实现视频转gif图片
video→canvas( drawImage )→ gif.js( addFram )→ gif.js ( render)
ctx.drawImage(video, 0, 0, width, height);
gif.addFrame(ctx, {copy: true, delay: millisec});
it = setInterval(function(){addFrame();},millisec);
gif.render();
gif.abort();
gif拓展
gif.js
JavaScript GIF编码器,运行在您的浏览器。
https://github.com/jnordberg/gif.js
libgif-js
JavaScript GIF解析器和播放器。
https://github.com/buzzfeed/libgif-js
ezgif
在线GIF优化器。
https://ezgif.com/optimize
如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK