A high-performance, flexible and easy to use Video compressor library written by Swift.

Version License Platform


Compress with quality param

Set VideoQuality to get different quality of video, beside:

VideoCompressorSwift().videoCompress(inputUrl: yourVideoPath, quality: .medium) { result in
            switch result {
            case .failure(let error):
            case .success(let url):

Compress with more customized

VideoCompressorSwift().videoCompress(inputUrl: url,
                                     outputFileType: .mov,
                                     videoSettings: VideoCompressorSwift().createVideoSettingsForPreset(.medium, 1000_000, size: CGSize(width: 640, height: 480)),
                                     audioSampleRate: 44100,
                                     audioBitrate: 128_000) { res in
            switch result {
            case .failure(let error):
            case .success(let url):


Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding VideoCompressorSwift as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "", .upToNextMajor(from: "0.0.1"))


Distributed under the MIT License. See LICENSE.txt for more information.


Habib Ghaffarzadeh – LinkedInTwitter[email protected]


View Github