Skip to content

Instantly share code, notes, and snippets.

@DevinThompson
Created September 6, 2019 16:59
Show Gist options
  • Save DevinThompson/46909372fb937debb6883d24894ec72f to your computer and use it in GitHub Desktop.
Save DevinThompson/46909372fb937debb6883d24894ec72f to your computer and use it in GitHub Desktop.
let blurRadius = 9.0
let asset = AVAsset(url: videoURL)
//MAKE IT BLURRED
playerItem.videoComposition = AVVideoComposition(asset: asset) {request in
let mutated = request.sourceImage.clampedToExtent().applyingFilter("CIColorPosterize").applyingGaussianBlur(sigma: blurRadius)
let output = mutated.clamped(to: request.sourceImage.extent)
request.finish(with: output, context: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment