PrismCore / Getting started
Installation
Add PrismCore 3.5.4 to an app or package with Swift Package Manager, pinned to an exact version.
PrismCore is distributed as a Swift package. FFmpeg arrives through MPVKit's prebuilt dynamic xcframeworks, so there is nothing to compile from C sources and no FFmpeg source is redistributed in the package. Dolby Vision RPU conversion uses libdovi, which MPVKit already links.
Swift Package Manager
Pin the exact release in your Package.swift:
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "MyPlayer",
platforms: [.iOS(.v16), .tvOS(.v17), .macOS(.v14), .visionOS(.v1)],
products: [
.library(name: "MyPlayer", targets: ["MyPlayer"]),
],
dependencies: [
.package(url: "https://github.com/Wenzlik/PrismCore.git", exact: "3.5.4"),
],
targets: [
.target(
name: "MyPlayer",
dependencies: [.product(name: "PrismCore", package: "PrismCore")]
),
]
)The library product is PrismCore. The package also builds prismcore-cli, a macOS diagnostic tool you run from a terminal — it is not something an app links (see Testing).
Xcode
- File ▸ Add Package Dependencies…
- Enter
https://github.com/Wenzlik/PrismCore.git. - Set Dependency Rule to Exact Version and enter
3.5.4. - Add the PrismCore library to your app target.
Why an exact version
PrismCore follows Semantic Versioning: every public declaration in Sources/PrismCore/ is the stability contract, breaking changes bump the major version, features the minor, fixes the patch. A from: "3.0.0" range is therefore safe for source compatibility.
Pin an exact version anyway if you archive through Xcode Cloud, or any CI that has automatic package resolution turned off, and keep your committed Package.resolved in step with it. A range lets local resolution ride ahead to a newer tag while the pinned file stays put — and then a device build and a TestFlight build are quietly running different engines.
MPVKit and FFmpeg
PrismCore depends on MPVKit .upToNextMinor(from: "1.0.0"). A host that already ships MPVKit adds no new binary dependencies.
What PrismCore can do with a source partly depends on the FFmpeg build that is actually loaded — most importantly whether it has an eac3 encoder (stock MPVKit has the E-AC-3 decoders only). Log the answer once at launch:
import PrismCore
print(FFmpegBuild.summary) // versions, ABI check, encoder and decoder capabilities
assert(FFmpegBuild.isABIMatched) // worth asserting if you vendor your own FFmpegFFmpegBuild.isABIMatched compares the major version of each linked library with the headers PrismCore was compiled against. A major mismatch means the structs the engine reads on every packet may be laid out differently, which shows up as wrong pixels and timestamps rather than as an error — PrismCore logs and reports that state but does not refuse to run.
Sandboxed macOS apps
The engine serves its playlists from a socket it binds on 127.0.0.1. In the macOS App Sandbox even a loopback bind() needs the com.apple.security.network.server entitlement, in addition to network.client for reaching remote sources. Without it the bind fails with EPERM.
Next
Continue with the Quick start, or check the platform requirements.