Skip to content

About

Minimal FFmpegKit 6.0 for Android and iOS: VP9 WebM with alpha via libvpx. dev.mediacache:ffmpegkit-vp9

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ffmpegkit-vp9

FFmpegKit 6.0 for Android and iOS, built with only what it takes to decode VP9 WebM with alpha to raw frames. The API is FFmpegKit's own (com.arthenica.ffmpegkit on Android, ffmpegkit on iOS); only the FFmpeg inside is smaller.

FFmpegKit itself is archived and its binaries are no longer published. These scripts build its last release (commit 1036d3c: FFmpeg 6.0, libvpx 1.13.0) with FFmpeg configured as --disable-everything plus:

  • the Matroska/WebM demuxer and the VP9 parser
  • the libvpx VP9 decoder, which keeps the alpha channel (FFmpeg's native VP9 decoder drops it)
  • the rawvideo encoder and muxer
  • the file and pipe protocols
  • the filters FFmpeg's command line needs for scaling, pixel format conversion and rotation
Default --enable-libvpx build ffmpegkit-vp9
Android AAR (arm-v7a, arm64-v8a, x86_64) 31 MB 4 MB
iOS XCFrameworks (arm64, simulator arm64/x86_64) 60 MB 11 MB

The Android libraries are 16 KB page aligned, as Google Play requires for Android 15+.

Usage

Android

dependencies {
    implementation 'dev.mediacache:ffmpegkit-vp9:6.0.0'
}

minSdk 24. The POM brings in com.arthenica:smart-exception-java, which FFmpegKit needs at runtime.

FFmpegSession session = FFmpegKit.execute(
    "-c:v libvpx-vp9 -i input.webm -an -pix_fmt yuva420p -f rawvideo frames.yuv");

Always pass -c:v libvpx-vp9 (only the libvpx decoder is built) and -an (there are no audio decoders).

iOS

iOS 12.1+. Eight dynamic XCFrameworks (ffmpegkit plus the FFmpeg libraries it links); whichever way you add them, they are embedded in the app.

Swift Package Manager: in Xcode, File → Add Package Dependencies → https://github.com/MediaCacheDev/ffmpegkit-vp9, or in Package.swift:

.package(url: "https://github.com/MediaCacheDev/ffmpegkit-vp9", exact: "6.0.0"),
// target dependency:
.product(name: "ffmpegkit-vp9", package: "ffmpegkit-vp9"),

CocoaPods:

pod 'ffmpegkit-vp9', '6.0.0'

CocoaPods trunk is read-only from 2 December 2026, so 6.0.0 is the last version on it. Later versions are used through the podspec at their tag:

pod 'ffmpegkit-vp9', :podspec => 'https://raw.githubusercontent.com/MediaCacheDev/ffmpegkit-vp9/<version>/ffmpegkit-vp9.podspec'

Manually: download ffmpegkit-vp9-6.0.0-ios-xcframeworks.zip from the release and add the frameworks with "Embed & Sign".

import ffmpegkit

let session = FFmpegKit.execute("-c:v libvpx-vp9 -i input.webm -an -pix_fmt yuva420p -f rawvideo frames.yuv")

Building

./scripts/build-android.sh   # → dist/android/ffmpegkit-vp9.aar
./scripts/build-ios.sh       # → dist/ios/Frameworks/*.xcframework
  • Android: the Android SDK, an NDK (the newest one under $ANDROID_HOME/ndk is used; override with FFMPEGKIT_NDK_HOME; r28 or newer for 16 KB pages, which the script checks) and Java 17.
  • iOS: Xcode.
  • The first build clones ffmpeg-kit and fetches FFmpeg and libvpx into build/. CLEAN=1 rebuilds from scratch.

Releasing

./scripts/package-release.sh          # → dist/release/: binaries, source tarballs, SHA256SUMS;
                                      #   also regenerates Package.swift and the podspec
./scripts/publish-android.sh local    # → ~/.m2
./scripts/publish-android.sh central  # → Central Portal deployment (needs credentials, see the script)

Commit Package.swift and ffmpegkit-vp9.podspec, tag the version, and create the GitHub Release with everything in dist/release/; SPM and CocoaPods read the tag and download from the release. The binaries name the release page as the place to get their source, so do this before publishing the Maven Central deployment.

Licence

The scripts are MIT. The binaries are LGPL-3.0 (FFmpegKit and FFmpeg), BSD-3-Clause (libvpx) and Apache-2.0 (cpu_features, Android only); see THIRD_PARTY_NOTICES.md.

About

Minimal FFmpegKit 6.0 for Android and iOS: VP9 WebM with alpha via libvpx. dev.mediacache:ffmpegkit-vp9

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages