Apply effect to the video frame shot by the camera

I noticed that for the developer, use android.media.effect for use at the api level 17. There is also a "Helloeffect" sample for the developer. However, the sample focuses on the image. I read the effect class file and found that it should apply the effect to GL textures. I am new to opengl and I want to apply the effect to the video frame captured by the camera.
Can someone give me some advice? Thank!

+48
android android-camera android-4.2-jelly-bean
May 28 '13 at 8:18
source share
1 answer

you can make a camera parameter and then apply a colorfilter to the parameter to get a different effect, but first you need to check the supported color filter for your device, it mainly depends on the device.

 Camera.Parameters p = camera.getParameters(); camera.Parameters parameters = camera.getParameters(); //this will provide the supporting parameter for your device. p.setSceneMode(Camera.Parameters.FLASH_MODE_AUTO); //it will set the flash mode. p.setColorEffect(Camera.Parameters.EFFECT_NEGATIVE); //it will set the color effect to the preview and recording videos. camera.setParameters(p); 

but be careful with the nexus device, I tested this method on the nexus 5, the camera preview was shown with effect, but the recording was performed as usual.

check it out, hope this helps.

+1
Sep 15 '15 at 4:29
source share



All Articles