Skip to content

superuser404notfound/FFmpegBuild

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FFmpegBuild

Slim FFmpeg xcframeworks for Apple platforms.
Demux, decode, and a thin HLS-fMP4 mux path for AVPlayer bridging. No network stack, no CLI binaries.


Why

Full FFmpeg builds for iOS land at 40-70 MB because they bundle a TLS stack, encoders, filters, and a dozen protocols your app will never use. For a player, most of that is dead weight. Apple already ships HTTP/3, URLSession, Network.framework, VideoToolbox and AVFoundation. So this build strips out everything you don't need and keeps what you do.

~10 MB per architecture, zero network dependencies, one build script.

In

Library What it does
libavformat Demux MKV, MP4, HLS, DASH, MPEG-TS, AVI, WebM, OGG, …
libavcodec Decode video + audio (with VideoToolbox bridge)
libavutil Shared primitives
libswresample Audio resampling / channel remap / format convert
dav1d Fast AV1 software decoder (separate xcframework)

Out

Anything the app layer should already handle or doesn't need:

  • Network / TLS: FFmpeg reads from an avio_alloc_context callback, you wire URLSession to it
  • Encoders, except FLAC (kept for the TrueHD / DTS / DTS-HD-MA → FLAC bridge that lets AVPlayer ingest lossless audio)
  • Muxers, except MP4 / MOV / HLS (kept for the HLS-fMP4 producer that wraps streams for AVPlayer)
  • libavfilter, libswscale, libavdevice
  • Programs (ffmpeg, ffplay, ffprobe)
  • Hardware accel layers other than VideoToolbox
  • Text subtitle rendering (do that in SwiftUI)

Build

./build.sh          # all platforms
./build.sh tvos     # single platform
./build.sh clean    # wipe everything

Needs Xcode 16+ and roughly 10-30 minutes depending on your machine. Both FFmpeg and dav1d sources clone on first run.

Output lands in Sources/ as xcframeworks, ready to consume via Swift Package Manager.

Use

// Package.swift
dependencies: [
    .package(url: "https://github.com/superuser404notfound/FFmpegBuild", branch: "main")
]

// Target:
.product(name: "FFmpegBuild", package: "FFmpegBuild")

Then import the modules you need: Libavformat, Libavcodec, Libavutil, Libswresample, Libdav1d.

Decoder support

  • Video (hardware via VideoToolbox): H.264, HEVC up to Main10 (HDR10/DV Profile 8)
  • Video (software): AV1 (dav1d), VP9, VP8, MPEG-2, MPEG-4, VC-1
  • Audio: AAC, AC3, EAC3 (incl. JOC detection for Atmos), FLAC, MP2, MP3, Opus, Vorbis, TrueHD, DTS, ALAC, PCM
  • Subtitles: SRT, ASS, SSA, WebVTT, PGS, DVB, DVD

HDR metadata (BT.2020, SMPTE ST 2084 / PQ, HLG, DV RPU) is preserved end-to-end so the decode pipeline can tag frames correctly.

Size

Per architecture, release configuration:

Target FFmpeg dav1d Total
iOS / tvOS arm64 ~9.4 MB ~1 MB ~10.4 MB
macOS arm64 ~9.5 MB ~1 MB ~10.5 MB
macOS x86_64 ~9.3 MB ~2.8 MB ~12.1 MB

Assembly-optimized paths are enabled where the Apple toolchain permits.

Built with

This package is vibe-coded, assembled and maintained by Vincent Herbst in close pair-programming with Claude (Anthropic). The commit log is the receipt: nearly every commit carries a Co-Authored-By: Claude trailer.

License

LGPL-3.0, same as upstream FFmpeg. App Store compatible when linked dynamically.


Used by AetherEngine.

About

Slim FFmpeg 7.1 + dav1d xcframeworks for iOS, tvOS and macOS. Demux and decode only — no network stack, no encoders, no CLI binaries.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages