*** in the works… almost fully tested and featured! *** check back soon or ask how to help!
NextLevel is a media capture library for iOS written in Swift.
Features
- simple and extensible API
- “Vine-like” video clip recording
- slow motion capture on supported hardware (iPhone, iPad)
- video zoom
- customizable user interface and gestural interactions
- white balance, focus, and exposure adjustment support
- flash/torch support
- mirroring support
- photo capture
- dual camera system support
- Swift 3
Quick Start
# CocoaPods pod "NextLevel", "~> 0.0.1" # Carthage github "nextlevel/NextLevel" ~> 0.0.1 # Swift PM let package = Package( dependencies: [ .Package(url: "https://github.com/nextlevel/NextLevel", majorVersion: 0) ] )
Alternatively, drop the NextLevel source files or project file into your Xcode project.
Community
NextLevel is a community – contributions and discussions are welcome!
- Feature idea? Open an issue.
- Found a bug? Open an issue.
- Need help? Use Stack Overflow with the tag ’nextlevel’.
- Questions? Use Stack Overflow with the tag 'nextlevel'.
- Want to contribute? Submit a pull request.
Stickers
If this project was helpful, check out the standardized sticker on Sticker Mule.
Complementary Projects
Need a video player?
Need an image processing library?
Need an obj-c media capture library?
Need a transcoding library?
Overview
Record Video Clips
Import the library.
Setup the camera preview.
let screenBounds = UIScreen.main.bounds self.previewView = UIView(frame: screenBounds) if let previewView = self.previewView { previewView.autoresizingMask = [.flexibleWidth, .flexibleHeight] previewView.backgroundColor = UIColor.black previewView.layer.addSublayer(NextLevel.sharedInstance.previewLayer) self.view.addSubview(previewView) }
Start, configure, and clean-up the NextLevel controller.
override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) // modify .videoConfiguration, .photoConfiguration, . audioConfiguration properties, if necessary NextLevel.sharedInstance.start() // … }
override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) NextLevel.sharedInstance.stop() // … }
Video Pause/Record
// pause NextLevel.sharedInstance.pause(nil) // record NextLevel.sharedInstance.record() // finalize NextLevel.sharedInstance.completeSession()
Handle the output and export the recorded session.
Configure video quality and compression
Configure automatic video duration limit
To enable automatic end of capture, you can specify a maximum duration on the .videoConfiguration property.
NextLevel.sharedInstance.videoConfiguration.maximumCaptureDuration = CMTimeMakeWithSeconds(5, 600)
About
Next Level is just a little weekend project that is still going.
The software provides foundational components for advanced media recording, camera interface customization, and gestural interaction customization on iOS. The same capture capabilities can also be found in apps such as Snapchat, Instagram, Vine, Peach, and others.
If it can provide a good foundation for quick integration, allowing everyone to focus on the functionality that makes the matters most – such as image processing, computer vision apps such as 3D photography or object mapping, augmented reality, depth of field, or even new cinematographic techniques.
Resources
- iOS Device Camera Summary
- AV Foundation Programming Guide
- AV Foundation Framework Reference
- Swift Evolution
- objc.io Camera and Photos
- objc.io Video
- Player, a simple iOS video player in Swift
- PBJVideoPlayer, a simple iOS video player in obj-c
- SCRecorder, obj-C iOS camera engine with Vine-like tap to record, filters, slow motion, segments editing
- PBJVision, obj-c iOS camera engine, features touch-to-record video, slow motion video, and photo capture
- GPUImage2, image processing library in Swift
- NextLevelSessionExporter, media export and transcoding library
License
NextLevel is available under the MIT license, see the LICENSE file for more information.
