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

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

我注意到在 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/

相关文章:

android - DialogFragment 使用 android.support.v4.app 还是 android.app?

android-camera - Android api 级别 7 上的 getPreviewFormat 和 setPreviewFormat

android - facebook.ads.InterstitialAdActivity Activity 空指针 ex

android - android平板电脑中的sqlite数据库在哪里?

android - 在 google app engine datastore 中保存 android 应用程序数据时出现异常

android - 避免Android中图库保存相机拍摄的照片

android - 如何以编程方式检测视频录制时间

android - ViewPager 中的 ScrollView 在 Android 4.x 上不滚动

android - 启用后无法禁用 DDMS 调试

android - SearchView 小部件未显示在操作栏中