1662269820
NextLevel
is a Swift camera system designed for easy integration, customized media capture, and image streaming in iOS. Integration can optionally leverage AVFoundation
or ARKit
.
Features | |
---|---|
π¬ | βVine-likeβ video clip recording and editing |
πΌ | photo capture (raw, jpeg, and video frame) |
π | customizable gestural interaction and interface |
π | ARKit integration (beta) |
π· | dual, wide angle, telephoto, & true depth support |
π’ | adjustable frame rate on supported hardware (ie fast/slow motion capture) |
π’ | depth data capture support & portrait effects matte support |
π | video zoom |
β | white balance, focus, and exposure adjustment |
π¦ | flash and torch support |
π― | mirroring support |
β | low light boost |
πΆ | smooth auto-focus |
β | configurable encoding and compression settings |
π | simple media capture and editing API |
π | extensible API for image processing and CV |
π | animated GIF creator |
π | face recognition; qr- and bar-codes recognition |
π¦ | Swift 5 |
Need a different version of Swift?
5.0
- Target your Podfile to the latest release or master4.2
- Target your Podfile to the swift4.2
branch
# CocoaPods
pod "NextLevel", "~> 0.16.3"
# Carthage
github "nextlevel/NextLevel" ~> 0.16.3
# 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.
ARKit and the True Depth Camera software features are enabled with the inclusion of the Swift compiler flag USE_ARKIT
and USE_TRUE_DEPTH
respectively.
Apple will reject apps that link against ARKit or the True Depth Camera API and do not use them.
If you use Cocoapods, you can include -D USE_ARKIT
or -D USE_TRUE_DEPTH
with the following Podfile
addition or by adding it to your Xcode build settings.
installer.pods_project.targets.each do |target|
# setup NextLevel for ARKit use
if target.name == 'NextLevel'
target.build_configurations.each do |config|
config.build_settings['OTHER_SWIFT_FLAGS'] = ['$(inherited)', '-DUSE_ARKIT']
end
end
end
Before starting, ensure that permission keys have been added to your app's Info.plist
.
<key>NSCameraUsageDescription</key>
<string>Allowing access to the camera lets you take photos and videos.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allowing access to the microphone lets you record audio.</string>
Import the library.
import NextLevel
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
NextLevel.shared.previewLayer.frame = previewView.bounds
previewView.layer.addSublayer(NextLevel.shared.previewLayer)
self.view.addSubview(previewView)
}
Configure the capture session.
override func viewDidLoad() {
NextLevel.shared.delegate = self
NextLevel.shared.deviceDelegate = self
NextLevel.shared.videoDelegate = self
NextLevel.shared.photoDelegate = self
// modify .videoConfiguration, .audioConfiguration, .photoConfiguration properties
// Compression, resolution, and maximum recording time options are available
NextLevel.shared.videoConfiguration.maximumCaptureDuration = CMTimeMakeWithSeconds(5, 600)
NextLevel.shared.audioConfiguration.bitRate = 44000
}
Start/stop the session when appropriate. These methods create a new "session" instance for 'NextLevel.shared.session' when called.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
NextLevel.shared.start()
// β¦
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
NextLevel.shared.stop()
// β¦
}
Video record/pause.
// record
NextLevel.shared.record()
// pause
NextLevel.shared.pause()
Editing and finalizing the recorded session.
if let session = NextLevel.shared.session {
//..
// undo
session.removeLastClip()
// various editing operations can be done using the NextLevelSession methods
// export
session.mergeClips(usingPreset: AVAssetExportPresetHighestQuality, completionHandler: { (url: URL?, error: Error?) in
if let _ = url {
//
} else if let _ = error {
//
}
})
//..
}
Videos can also be processed using the NextLevelSessionExporter, a media transcoding library in Swift.
βNextLevelβ was designed for sample buffer analysis and custom modification in real-time along side a rich set of camera features.
Just to note, modifications performed on a buffer and provided back to NextLevel may potentially effect frame rate.
Enable custom rendering.
NextLevel.shared.isVideoCustomContextRenderingEnabled = true
Optional hook that allows reading sampleBuffer
for analysis.
extension CameraViewController: NextLevelVideoDelegate {
// ...
// video frame processing
public func nextLevel(_ nextLevel: NextLevel, willProcessRawVideoSampleBuffer sampleBuffer: CMSampleBuffer) {
// Use the sampleBuffer parameter in your system for continual analysis
}
Another optional hook for reading buffers for modification, imageBuffer
. This is also the recommended place to provide the buffer back to NextLevel for recording.
extension CameraViewController: NextLevelVideoDelegate {
// ...
// enabled by isCustomContextVideoRenderingEnabled
public func nextLevel(_ nextLevel: NextLevel, renderToCustomContextWithImageBuffer imageBuffer: CVPixelBuffer, onQueue queue: DispatchQueue) {
// provide the frame back to NextLevel for recording
if let frame = self._availableFrameBuffer {
nextLevel.videoCustomContextImageBuffer = frame
}
}
NextLevel will check this property when writing buffers to a destination file. This works for both video and photos with capturePhotoFromVideo
.
nextLevel.videoCustomContextImageBuffer = modifiedFrame
NextLevel was initally a weekend project that has now grown into a open community of camera platform enthusists. The software provides foundational components for managing media recording, camera interface customization, gestural interaction customization, and image streaming on iOS. The same capabilities can also be found in apps such as Snapchat, Instagram, and Vine.
The goal is to continue to provide a good foundation for quick integration (enabling projects to be taken to the next level) β allowing focus to placed on functionality that matters most whether it's realtime image processing, computer vision methods, augmented reality, or computational photography.
NextLevel provides components for capturing ARKit video and photo. This enables a variety of new camera features while leveraging the existing recording capabilities and media management of NextLevel.
If you are trying to capture frames from SceneKit for ARKit recording, check out the examples project.
You can find the docs here. Documentation is generated with jazzy and hosted on GitHub-Pages.
If you found this project to be helpful, check out the Next Level stickers.
NextLevel is a community β contributions and discussions are welcome!
Author: NextLevel
Source code: https://github.com/NextLevel/NextLevel
License: MIT license
#swift
1600430400
Swift is a fast and efficient general-purpose programming language that provides real-time feedback and can be seamlessly incorporated into existing Objective-C code. This is why developers are able to write safer, more reliable code while saving time. It aims to be the best language that can be used for various purposes ranging from systems programming to mobile as well as desktop apps and scaling up to cloud services.
Below here, we list down the 10 best online resources to learn Swift language.
(The list is in no particular order)
#developers corner #free online resources to learn swift language #learn swift #learn swift free #learn swift online free #resources to learn swift #swift language #swift programming
1609999986
A thoroughly researched list of top Swift developers with ratings & reviews to help find the best Swift development companies around the world.
#swift development service providers #best swift development companies #top swift development companies #swift development solutions #top swift developers #swift
1594193714
Want to create a native iOS application for your Startup?
Hire Dedicated Swift Developers for end-to-end services like development, migration, upgrade, testing, and support & maintenance. Trust HourlyDeveloper.io our Swift development team for iOS device apps that are high on performance and security.
Consult with experts:- https://bit.ly/2C5M6cz
#hire dedicated swift developers #swift developers #swift development company #swift development services #swift development #swift
1625816471
Efficient social media management could mean you getting the desired online recognition and leads for your business (if that was your intend to stay active on social media). Unfortunately, the common practice of social media management requires you to switch between multiple accounts of yours. This requires significant time and effort on your part. Stratus addresses this problem by bringing all of the social media channels on a single platform. You can access and manage your social media accounts in a single place while saving your time and effort. The user-friendly interface and advanced features integrated into the Stratus platform make it one of the best social media posting tools. To learn more or to sign up on Stratus, visit https://stratus.co/
#best social media posting tools #social media management #manage social media accounts in one place #best social media management tools #manage all social media in one place #social media management tools
1603285318
Hire an Exceptional Swift App Developer from Mobile App Development India. Maadi has a dedicated Swift App Development team that is superiorly talented and builds highly functional, cost-effective mobile apps with error-free coding.
Contact: https://www.mobile-app-development-india.com/swift-app-development/
#swift ios app development india #hire swift programmer india #swift ios development #apple swift app development #swift mobile app development #swift app development