gpt4 book ai didi

android - 对相机拍摄的视频帧应用效果

转载 作者:IT王子 更新时间:2023-10-28 23:46:15 25 4
gpt4 key购买 nike

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

最佳答案

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

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中检查了这个方法,相机预览显示效果很好,但录制正常。

看看,希望对你有帮助。

关于android - 对相机拍摄的视频帧应用效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16787160/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com