Is there any way to blur AVCaptureSession's videoPreviewLayer ?

时间:2016-10-20 12:38:51

标签: ios calayer

I have a custom camera created AVCaptureSession and i want to "blur" the AVCaptureVideoPreviewLayer(a layer with blur effect would be nice). I know about UIVisualEffectView,as i know, there is not any way to modify it's layer,so i could animate it's path. Any suggestions ?

1 个答案:

答案 0 :(得分:0)

为了实现这一点,我创建了一个遮罩并将其应用于UIVisualEffectView。

Heres是完整指南

使用模糊效果创建UIVisualEffectView。将其作为子视图添加到您的视图中,因此它将覆盖videoPreviewLayer。创建一个带孔的面具。将该掩码应用于visualEffectView。