                 if status == AVKeyValueStatus.loaded,
                    let reader = try? AVAssetReader(asset: asset) {
                     self.reader = reader
-                    let tracks = asset.tracks(withMediaType: AVMediaTypeVideo)
+                    let track = asset.tracks(withMediaType: AVMediaTypeVideo)[0]
                     let settings:[String:Any] = [kCVPixelBufferPixelFormatTypeKey as String:kCVPixelFormatType_32BGRA]
-                    let output = AVAssetReaderTrackOutput(track: tracks[0], outputSettings: settings)
+                    let output = AVAssetReaderTrackOutput(track: track, outputSettings: settings)
                     self.output = output
                     reader.add(output)
                     reader.startReading()

                            self.texture = texture.texture
                        }
                        self.context.flush()
                        self.processNext()
                    }
                })
                commandBuffer?.commit()

    
    func processNext() {
        guard let reader = self.reader,
            let writer = self.writer,
            let output = self.output else {
                return
        }
