如何在像Instagram这样的Android上实现视频过滤器 [英] How to implement Video filter on android like instagram

查看:205
本文介绍了如何在像Instagram这样的Android上实现视频过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的Android应用(例如 Instagram )中添加视频过滤器.我搜索了很多,但没有发现太多东西.是否有像aviary sdk这样的库来进行图像编辑?

I need to add video filter in my android app like Instagram. I searched alot but did not find much stuff. Is there any library for this like aviary sdk for image editing ?

推荐答案

最简单的方法是使用适用于Java的OpenCV库(将其导入Android项目可能很麻烦)-它使您能够轻松地将每个帧提取到可以在其上应用过滤器的各种类型的Image对象(不确定OpenCV是否包含用于执行此操作的工具),然后使用修改后的帧组成新的Video.

The shortest way to do this would be using OpenCV library for Java (importing it to Android project could be trcky) - it enables you to easaly extract each frame to different types of Image objects on which you can apply your filter (not sure if OpenCV contains tools for doing this) and then composing a new Video with modified frames.

请记住,这可能会占用大量CPU和电池,而且我不确定在各种硬件配置下如何使用.

Have in mind that this might be highly both CPU and battery consuming and I am not quite sure how would this work on various hardware configurations.

另一个(更长的)解决方案是深入研究Android NDK并尝试使用ffmpeg.总而言之,这可能会减少CPU负载.

The other - longer - solution is to dig in to Android NDK and try to use ffmpeg. All in all it might decrease CPU load.

新的Android L版本还将为Camera提供一些基本过滤器(不确定是否包括视频) https://www.youtube.com/watch?v=Xtp3tH27OFs ,因此您可以等待一些Compat库

Also the new Android L release will provide some basic filters for Camera (not sure if this includes videos) https://www.youtube.com/watch?v=Xtp3tH27OFs so you could wait for some Compat library

这篇关于如何在像Instagram这样的Android上实现视频过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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