Swiftpack.co - kewlbear/FFmpeg-iOS as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kewlbear.
kewlbear/FFmpeg-iOS 0.0.3
Swift package of FFmpeg libraries for iOS
⭐️ 87
🕓 1 week ago
.package(url: "https://github.com/kewlbear/FFmpeg-iOS.git", from: "0.0.3")


This swift package enables you to use FFmpeg libraries in your iOS, Mac Catalyst and tvOS apps.


.package(url: "https://github.com/kewlbear/FFmpeg-iOS.git", from: "0.0.1")


import avformat

var ifmt_ctx: UnsafeMutablePointer<AVFormatContext>?
var ret = avformat_open_input(&ifmt_ctx, filename, nil, nil)

See https://github.com/kewlbear/YoutubeDL-iOS.

Building Libraries

You can install build tool


$ mint install kewlbear/FFmpeg-iOS

or run from source.

Swift Package Manager

git clone https://github.com/kewlbear/FFmpeg-iOS.git
cd FFmpeg-iOS

You should omit "swift run" from following commands if you installed build tool.

To download FFmpeg source and build .xcframeworks:

$ swift run ffmpeg-ios

To build fat libraries:

$ swift run ffmpeg-ios --disable-xcframework 

To download x264 source and build fat libraries:

$ swift run ffmpeg-ios x264 --disable-xcframework

For other usages:

$ swift run ffmpeg-ios -h
OVERVIEW: Build FFmpeg libraries for iOS as xcframeworks

USAGE: ffmpeg-ios <subcommand>

 -h, --help              Show help information.

 build (default)         Build framework module
 framework               Create .xcframework
 module                  Enable modules to allow import from Swift
 fat                     Create fat library
 dep                     Install build dependency
 source                  Download library source code

 See 'ffmpeg-ios help <subcommand>' for detailed help.
 $ swift run ffmpeg-ios build -h
 OVERVIEW: Build framework module

 USAGE: ffmpeg-ios build <options>

   <lib>                   ffmpeg, fdk-aac, lame or x264 (default: ffmpeg)

   --enable-libfdk-aac     enable AAC de/encoding via libfdk-aac 
   --enable-libx264        enable H.264 encoding via x264 
   --enable-libmp3lame     enable MP3 encoding via libmp3lame 
   --disable-xcframework   Create fat library instead of .xcframework 
   --source-directory <source-directory>
                           Library source directory (default: ./<lib>) 
   --build-directory <build-directory>
                           directory to contain build artifacts (default: ./build)
   --arch <arch>           architectures to include (default: arm64, x86_64)
   --library <library>     libraries to include (default: avcodec, avdevice, avfilter, avformat, avutil, swresample, swscale)
   --deployment-target <deployment-target>
                           (default: 12.0)
   --extra-options <extra-options>
                           additional options for configure script 
   --release <release>     FFmpeg release (default: snapshot)
   --url <url>
   --frameworks <frameworks>
                           (default: ./Frameworks)
   --output <output>       default: <lib>-fat 
   --fdk-aac-source <fdk-aac-source>
                           (default: ./fdk-aac-2.0.1)
   --x264-source <x264-source>
                           (default: ./x264-master)
   --lame-source <lame-source>
                           (default: ./lame-3.100)
   -h, --help              Show help information.



LGPL v2.1+


Stars: 87
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1 year ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics