Reproducción de video GPUImage y swift

Quiero procesar un video con el filter cromático y la salida debe reproducirse en la pantalla.

Debajo del código que desarrollé que no muestra ningún video y no puedo entender por qué:

override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. let aSelector : Selector = "start:" let tapGesture = UITapGestureRecognizer(target: self, action: aSelector) tapGesture.numberOfTapsRequinetworking = 1 view.addGestureRecognizer(tapGesture) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func start(sender: AnyObject) { NSLog("tap pressed") play() } func play(){ let path = NSBundle.mainBundle().pathForResource("glass_buster", ofType: "mp4") let player = AVPlayer() let pathURL = NSURL.fileURLWithPath(path!) NSLog(pathURL.absoluteString) let playerItem = AVPlayerItem(URL: pathURL) player.replaceCurrentItemWithPlayerItem(playerItem) let gpuMovie = GPUImageMovie(playerItem: playerItem) gpuMovie.playAtActualSpeed = true let filter = GPUImageChromaKeyFilter() gpuMovie.addTarget(filter) gpuMovie.playAtActualSpeed = true gpuMovie.startProcessing() player.play() } 

También necesita una GPUImageView que muestre la película y no pueda almacenar el reproductor en una var local. Prueba lo siguiente:

 var player: AVPlayer! = nil var playerItem : AVPlayerItem! = nil func play() { let path = NSBundle.mainBundle().pathForResource("glass_buster", ofType: "mp4") player = AVPlayer() let pathURL = NSURL.fileURLWithPath(path!) playerItem = AVPlayerItem(URL: pathURL) player.replaceCurrentItemWithPlayerItem(playerItem) let gpuMovie = GPUImageMovie(playerItem: playerItem) gpuMovie.playAtActualSpeed = true let filtenetworkingView: GPUImageView = GPUImageView(); filtenetworkingView.frame = self.view.frame self.view.addSubview(filtenetworkingView) let filter = GPUImageChromaKeyFilter() gpuMovie.addTarget(filter) gpuMovie.playAtActualSpeed = true filter.addTarget(filtenetworkingView) gpuMovie.startProcessing() player.play() }