The shortest way to do this is to use the OpenCV library for Java (importing it into an Android project can be a trick) - it allows you to easily extract each frame for various types of image objects that you can apply your filter to (not if OpenCV contains tools for this ), and then create a new video with the modified frames.
Keep in mind that this can be very related to CPU and battery consumption, and I'm not quite sure how this will work with various hardware configurations.
Another is a longer solution - dig into the Android NDK and try using ffmpeg. In general, this can reduce the load on the processor.
In addition, the new version of Android L will provide some basic filters for the camera (not sure if this video includes) https://www.youtube.com/watch?v=Xtp3tH27OFs so you can wait for some socket library
source share