如何编程视频转换为GIF的机器人 [英] How to convert video to gif in android programmatically

查看:182
本文介绍了如何编程视频转换为GIF的机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以转换记录视频 GIF 在Android的编程? 你能帮助我做一些狙击code或告诉我该怎么办呢?

解决方案
  1. 导入在你的项目的ffmpeg ,抓住部分或整个视频并将其转换为GIF。

  2. 使用 MediaRetriever 来提取帧的范围,简单的遍历的范围,然后转换为可绘制或位图,所以你可以将它保存。

  3. 抢帧,而视频是从 SurfaceViewHolder SurfaceView 画布玩。

Is it possible to convert recorded video into GIF in Android programmatically? Can you help me with some sniped code or tell me how to do it?

解决方案

  1. Import ffmpeg in your project, grab the portion or entire video and convert it to gif.

    or

  2. Use MediaRetriever to extract range of frames with simple looping through the range and then converting to Drawable or Bitmap so you can save it.

    or

  3. Grab the frames while the video is playing from the SurfaceViewHolder or SurfaceView Canvas.

这篇关于如何编程视频转换为GIF的机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆