Skip to content

Importing iOS Frameworks

Taner Sener edited this page Jul 15, 2026 · 2 revisions

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.

Swift Package Manager

Use this option for new Xcode projects and for projects that can consume a local package.

  1. In Xcode, select File -> Add Package Dependencies.

  2. Choose Add Local....

  3. Select the generated folder, for example:

    prebuilt/bundle-apple-xcframework-ios-12.1/
    
  4. Add the ffmpeg-kit package product to the app target.

  5. 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.

Manual xcframework Integration

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.

Manual framework Integration

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.sh

For Mac Catalyst framework bundles, the script is stored under framework resources:

${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/ffmpegkit.framework/Resources/strip-frameworks.sh

System Libraries

Always 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.

Notes

  • 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

Clone this wiki locally