-
Notifications
You must be signed in to change notification settings - Fork 25
Importing iOS Frameworks
FFmpegKitNext artifacts are produced locally. Build the iOS package by following Building iOS and iPadOS, then add the generated local package, xcframeworks, or framework bundles to your Xcode project.
Use this option for new Xcode projects and for projects that can consume a local package.
-
In Xcode, select
File->Add Package Dependencies. -
Choose
Add Local.... -
Select the generated folder, for example:
prebuilt/bundle-apple-xcframework-ios-12.1/ -
Add the
ffmpeg-kitpackage product to the app target. -
Import the module from Swift:
import ffmpegkit
For Objective-C sources, include the framework header:
#include <ffmpegkit/FFmpegKit.h>Regenerate the package after changing enabled libraries, architectures, build type, or deployment target. The
Package.swift references the local xcframeworks by relative path, so keep the generated folder together with the
framework bundles it was created for.
Use this option when you do not want to add the local Swift package.
Build with -x or --xcframework, then add every generated xcframework from the iOS output folder to the app target:
ffmpegkit.xcframework
libavcodec.xcframework
libavdevice.xcframework
libavfilter.xcframework
libavformat.xcframework
libavutil.xcframework
libswresample.xcframework
libswscale.xcframework
In General -> Frameworks, Libraries and Embedded Content, set the generated xcframeworks to Embed & Sign for
the final app target. If they are not copied into the Xcode project, make sure Framework Search Paths points to the
generated output folder.
Mac Catalyst support is part of the iOS xcframework output when the Mac Catalyst architectures are enabled.
If you build without -x, framework bundles are created under folders named like:
prebuilt/bundle-apple-framework-ios-12.1/
Add all generated .framework bundles from that folder, not only ffmpegkit.framework.
For app targets, embed and sign the generated frameworks. Add a Run Script phase after Embed Frameworks so unsupported
slices are removed from the final app bundle:
${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/ffmpegkit.framework/strip-frameworks.shFor Mac Catalyst framework bundles, the script is stored under framework resources:
${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/ffmpegkit.framework/Resources/strip-frameworks.shAlways link ffmpegkit together with all generated FFmpeg libraries listed above. If your build enables platform/system
options, Xcode may also need the corresponding Apple framework or system library:
-
--enable-ios-audiotoolbox:AudioToolbox -
--enable-ios-avfoundation:AVFoundation -
--enable-ios-bzip2:libbz2 -
--enable-ios-libiconv:libiconv -
--enable-ios-videotoolbox:VideoToolbox -
--enable-ios-zlib:libz
Some external library combinations may add more link requirements. For example, rubberband and tesseract link
Accelerate.
- iPadOS apps use the iOS output.
- Do not mix frameworks from different builds, deployment targets, or enabled-library sets.
- Rebuild and re-import the artifacts after changing build options.
Copyright (c) 2026 FFmpegKitNext
- Status
- Versions
- Changelog
- Project Layout
- Using
- Building
- External Libraries
- Patents
- License