48

我注意到android.media.effect开发人员可以在 api 级别 17 中使用。还有一个示例“Helloeffect”供开发人员渲染。但是,样本是集中在一张图片上的。GL我阅读了效果类的文件,发现它必须对纹理应用效果。我是新手opengl,我想对相机捕获的视频帧应用效果。
谁能给我一些提示?谢谢!

4

1 回答 1

1

您可以制作相机的参数,然后对参数应用颜色过滤器以获得不同的效果,但首先您必须检查您的设备支持的颜色过滤器,基本上它取决于设备。

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);

但要小心 nexus 设备,我已经在 nexus 5 中检查了这个方法,相机预览显示效果很好,但录制正常。

检查一下,希望它会有所帮助。

于 2015-09-15T04:29:53.443 回答