NextLevelSessionExporter alternatives and similar libraries
Based on the "Video" category.
Alternatively, view NextLevelSessionExporter alternatives based on common mentions on social networks and blogs.
-
MobilePlayer
:iphone: :movie_camera: A powerful and completely customizable media player for iOS -
BMPlayer
A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles. -
Cabbage
A video composition framework build on top of AVFoundation. It's simple to use and easy to extend. -
PryntTrimmerView
A set of tools to trim, crop and select frames inside a video -
MMPlayerView
Custom AVPlayerLayer on view and transition player with good effect like youtube and facebook -
VGPlayer
A simple iOS video player, support play local and network, background playback mode, automatic caching while playing. -
SwiftVideoBackground
๐น Framework to Play a Video in the Background of any UIView -
Kitsunebi
Overlay alpha channel video animation player view using Metal. -
Swifty360Player
iOS 360-degree video player streaming from an AVPlayer. -
PlayerView
Player View is a delegated view using AVPlayer of Swift -
YiVideoEditor
YiVideoEditor is a library for rotating, cropping, adding layers (watermark) and as well as adding audio (music) to the videos.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of NextLevelSessionExporter or a related project?
README
NextLevelSessionExporter ๐
NextLevelSessionExporter
is an export and transcode media library for iOS written in Swift.
The library provides customizable audio and video encoding options unlike AVAssetExportSession
and without having to learn the intricacies of AVFoundation. It was a port of SDAVAssetExportSession with inspiration from SCAssetExportSession โ which are great obj-c alternatives.
Need a different version of Swift?
5.0
- Target your Podfile to the latest release or master4.2
- Target your Podfile to theswift4.2
branch4.0
- Target your Podfile to theswift4.0
branch
Quick Start
# CocoaPods
pod "NextLevelSessionExporter", "~> 0.4.5"
# Carthage
github "nextlevel/NextLevelSessionExporter" ~> 0.4.5
# Swift PM
let package = Package(
dependencies: [
.Package(url: "https://github.com/nextlevel/NextLevelSessionExporter", majorVersion: 0)
]
)
Alternatively, drop the source files into your Xcode project.
Example
Simply use the AVAsset
extension or create and use an instance of NextLevelSessionExporter
directly.
let tmpURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
.appendingPathComponent(ProcessInfo().globallyUniqueString)
.appendingPathExtension("mp4")
exporter.outputURL = tmpURL
let compressionDict: [String: Any] = [
AVVideoAverageBitRateKey: NSNumber(integerLiteral: 6000000),
AVVideoProfileLevelKey: AVVideoProfileLevelH264HighAutoLevel as String,
]
let videoOutputConfig = [
AVVideoCodecKey: AVVideoCodec.h264,
AVVideoWidthKey: NSNumber(integerLiteral: 1920),
AVVideoHeightKey: NSNumber(integerLiteral: 1080),
AVVideoScalingModeKey: AVVideoScalingModeResizeAspectFill,
AVVideoCompressionPropertiesKey: compressionDict
]
let audioOutputConfig = [
AVFormatIDKey: kAudioFormatMPEG4AAC,
AVEncoderBitRateKey: NSNumber(integerLiteral: 128000),
AVNumberOfChannelsKey: NSNumber(integerLiteral: 2),
AVSampleRateKey: NSNumber(value: Float(44100))
]
let asset = AVAsset(url: Bundle.main.url(forResource: "TestVideo", withExtension: "mov")!)
asset.nextlevel_export(outputURL: tmpURL, videoOutputConfiguration: videoOutputConfig, audioOutputConfiguration: audioOutputConfig)
Alternatively, you can use NextLevelSessionExporter
directly.
let exporter = NextLevelSessionExporter(withAsset: asset)
exporter.outputFileType = AVFileType.mp4
let tmpURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true)
.appendingPathComponent(ProcessInfo().globallyUniqueString)
.appendingPathExtension("mp4")
exporter.outputURL = tmpURL
let compressionDict: [String: Any] = [
AVVideoAverageBitRateKey: NSNumber(integerLiteral: 6000000),
AVVideoProfileLevelKey: AVVideoProfileLevelH264HighAutoLevel as String,
]
exporter.videoOutputConfiguration = [
AVVideoCodecKey: AVVideoCodec.h264,
AVVideoWidthKey: NSNumber(integerLiteral: 1920),
AVVideoHeightKey: NSNumber(integerLiteral: 1080),
AVVideoScalingModeKey: AVVideoScalingModeResizeAspectFill,
AVVideoCompressionPropertiesKey: compressionDict
]
exporter.audioOutputConfiguration = [
AVFormatIDKey: kAudioFormatMPEG4AAC,
AVEncoderBitRateKey: NSNumber(integerLiteral: 128000),
AVNumberOfChannelsKey: NSNumber(integerLiteral: 2),
AVSampleRateKey: NSNumber(value: Float(44100))
]
exporter.export(progressHandler: { (progress) in
print(progress)
}, completionHandler: { result in
switch result {
case .success(let status):
switch status {
case .completed:
print("NextLevelSessionExporter, export completed, \(exporter.outputURL?.description ?? "")")
break
default:
print("NextLevelSessionExporter, did not complete")
break
}
break
case .failure(let error):
print("NextLevelSessionExporter, failed to export \(error)")
break
}
})
Documentation
You can find the docs here. Documentation is generated with jazzy and hosted on GitHub-Pages.
Community
- Found a bug? Open an issue.
- Feature idea? Open an issue.
- Want to contribute? Submit a pull request.
Resources
- AV Foundation Programming Guide
- AV Foundation Framework Reference
- NextLevel, Rad Media Capture in Swift
- GPUImage2, image processing library in Swift
- SDAVAssetExportSession, media transcoding library in obj-c
License
NextLevelSessionExporter
is available under the MIT license, see the LICENSE file for more information.
*Note that all licence references and agreements mentioned in the NextLevelSessionExporter README section above
are relevant to that project's source code only.