Make a color in a video transparent

43 Views Asked by At

I would like to make a specified color in a video transparent in Swift and then save it with the edit.

How could I change the transparency of a color?

let player = AVPlayerView(frame: CGRect(origin: .zero, size: videoSize))
let url: URL = Bundle.main.url(forResource: "video", withExtension: "mp4")!
let video = createTransparentItem(url: url)
        
player.loadPlayerItem(playerItem) { [weak self] result in
    switch result {
            case .failure(let error):
                return print("Something went wrong", error)

            case .success(let player):
                // play
                player.play()
                // Animate background
                self?.animateBackgroundColor()
            }
        }
0

There are 0 best solutions below