【问题标题】:Apply effect to video frame captured by camera对相机拍摄的视频帧应用效果
【发布时间】:2013-05-23 03:15:24
【问题描述】:

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

【问题讨论】:

标签: android android-camera android-4.2-jelly-bean


【解决方案1】:

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

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

看看,希望对你有帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多