         }
     }
 }
+
+
+extension CMTime {
+    var msS: (Int, Int, Int) {
+        let duration = CMTimeGetSeconds(self)
+        let minutes = Int(floor(duration / 60))
+        let seconds = Int(floor(duration - Double(minutes) * 60))
+        let milliseconds = Int((duration - floor(duration)) * 100)
+        return (minutes, seconds, milliseconds)
+    }
+
+    var stringInmmssSS: String {
+        let (minutes, seconds, milliseconds) = msS
+        return String(format: "%02d:%02d.%02d", minutes, seconds, milliseconds)
+    }
+
+    var stringInmmmsssSS: String {
+        let (minutes, seconds, milliseconds) = msS
+        return String(format: "%02dm%02ds%02d", minutes, seconds, milliseconds)
+    }
+}
+

        guard let _ = try? NSFileManager.defaultManager().createDirectoryAtPath(outputDir.path!, withIntermediateDirectories: true, attributes: nil) else { return }

        let assetIdentifier = NSUUID().UUIDString
        let tmpImagePath = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("\(assetIdentifier).tiff").path!
        let tmpMoviePath = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("\(assetIdentifier).mov").path!
        let imagePath = outputDir.URLByAppendingPathComponent("\(assetIdentifier).JPG").path!
        let moviePath = outputDir.URLByAppendingPathComponent("\(assetIdentifier).MOV").path!
        let paths = [tmpImagePath, tmpMoviePath, imagePath, moviePath]

        for path in paths {

    }

    init!(movieURL: NSURL) {
        self.movieURL = movieURL
        playerItem = AVPlayerItem(URL: movieURL)
        player = AVPlayer(playerItem: playerItem)
        playerView.player = player
