Created
September 6, 2019 16:59
-
-
Save DevinThompson/46909372fb937debb6883d24894ec72f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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