NKJMovieComposer 1.2.0

NKJMovieComposer 1.2.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Feb 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by nakajijapan.



NKJMovieComposer

NKJMovieComposer is very simple movie composer for iOS.

demo image

Requirements

NKJMovieComposer higher requires Xcode 6, targeting either iOS 8.0 and above, or Mac OS 10.10 OS X and above.

  • AVFoundation.framework

Usage

1.Initialize

    let movieComposition = NKJMovieComposer()

2.Simple Example

Append Movies.

        // movie
        let movieURL = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("movie001", ofType: "mov"))
        layerInstruction = movieComposition.addVideo(movieURL)

3.Save File

        // compose
        self.assetExportSession = movieComposition.readyToComposeVideo(composedMoviePath)
        let composedMovieUrl = NSURL.fileURLWithPath(composedMoviePath)

        // export
        self.assetExportSession.exportAsynchronouslyWithCompletionHandler({() -> Void in


            // save to device
            var library = ALAssetsLibrary()

            if library.videoAtPathIsCompatibleWithSavedPhotosAlbum(composedMovieUrl) {
                library.writeVideoAtPathToSavedPhotosAlbum(composedMovieUrl, completionBlock: {(assetURL, assetError) -> Void in


                     // something code


                })

             }


        })

Author

nakajijapan

License

NKJMovieComposer is available under the MIT license. See the LICENSE file for more info.