Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apply effect to video frame captured by camera

I noticed that there is android.media.effect for developer to use in api level 17. There is also a sample 'Helloeffect' for developer to render. However, the sample is focus on a picture. I read the file of effect class and found it must apply an effect to GL textures. I'm new on opengl and I want to apply an effect to the video frame captured by the camera.
Can anyone give me some hints? Thanks!

like image 992
Brendon Tsai Avatar asked May 28 '13 08:05

Brendon Tsai


Video Answer


1 Answers

you can make the parameter of camera, and then apply colorfilter to the parameter to get the different effect, but first you have to check the supported colorfilter for your device, basically it is device dependent.

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 nexus device , i had checked this method into nexus 5, the camera preview was showing with effect, but recording was done as normal.

check it out, hope it will help.

like image 131
Shubham Avatar answered Sep 28 '22 09:09

Shubham