Android视频删除色度键背景 [英] Android video remove chroma key background
问题描述
It is very similar:
I want to record a video with android camera.
After that with a library remove the background, which is with chroma key.
First I think I should use android NDK in order to escape from SDK memory limitation and use the whole memory.
The length of the video is short, a few seconds so maybe is able to handle it.
I would prefer to use an SDK implementation and set the android:largeHeap="true"
, because of mismatching the .so files architecture.
请提供有关SDK或NDK的任何库建议.
Any library suggestion for SDK or NDK please.
推荐答案
IMO,您应该更喜欢基于NDK的解决方案,因为视频处理是一项占用CPU的操作,而Java代码不会为您提供更好的性能.而且,最流行,最可靠的媒体处理库通常是用C或C ++编写的.
IMO you should prefer NDK based solution, since video processing is a CPU-consuming operation and java code won't give you a better performance. Moreover, the most popular and reliable media-processing libraries are often written in C or C++.
我建议您看看 FFmpeg .它提供了应对多媒体的能力. chromakey
过滤器可以帮助您删除绿色背景(或任何颜色)你要).然后,如果需要,您可以将另一个视频用作新背景.请参阅 blend
过滤器文档.
I'd recommend you to take a look at FFmpeg. It offers reach abilities to cope with multimedia. chromakey
filter may help you to remove green background (or whatever color you want). Then you can use another video as new background, if needed. See blend
filter docs.
过滤器是一个很好的强大概念.可以通过ffmpeg
工具命令行或通过 libavfilter
来使用它们. API.对于前一种情况,您应该找到为Android编译的ffmpeg
二进制文件,并使用传统的Runtime.exec()
运行它.对于后一种情况,您需要编写本机代码,以创建适当的过滤器图并执行处理.此代码必须与FFmpeg库链接.
Filters are a nice and powerful concept. They may be used both via ffmpeg
tool command line or via libavfilter
API. For the former case you should find ffmpeg
binary compiled for android and run it with traditional Runtime.exec()
. For the latter case - you need to write native code, that creates proper filter graph and performs processing. This code must be linked against FFmpeg libraries.
这篇关于Android视频删除色度键背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!