简体   繁体   中英

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM