Apply effect to video frame captured by camera
Asked Answered
S

1

48

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!

Sonorant answered 28/5, 2013 at 8:18 Comment(4)
Have you done this? applied effects to video using android.media.effects package? if yes, please can you post some sample code...Ante
Please see this #31806337Thorr
are you building upon the 'Helloeffect' sample provided ?. If yes then just convert the captured frame to a bitmap and replace it to the bitmap being used in the sample.Schlessinger
a little help - #22508776Gravelly
C
1

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.

Cathrin answered 15/9, 2015 at 4:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.