-
Notifications
You must be signed in to change notification settings - Fork 25
FFmpegKit Protocols
FFmpegKitNext includes custom FFmpeg URL protocols for data that is not best
handled as a normal filesystem path. These protocols are mostly hidden behind
FFmpegKit API wrappers: you create a wrapper object, get a URL from it, pass
that URL to an FFmpeg or FFprobe command, and close the wrapper when finished.
Use these protocols when you need one of these workflows:
- Access an Android document picker URI
- Pass bytes already held in memory to FFmpeg
- Capture FFmpeg output directly into memory
- Feed FFmpeg incrementally while a command is running
- Read FFmpeg output incrementally while a command is running
| Protocol | Purpose | Android | Apple | Linux | Flutter | React Native |
|---|---|---|---|---|---|---|
ffkitsaf: |
Android Storage Access Framework documents | yes | no | no | Android only | Android only |
ffkitmem: |
Seekable in-memory input/output | yes | yes | yes | yes | yes |
ffkitstream: |
Non-seekable streaming input/output | yes | yes | yes | yes | yes |
Flutter and React Native expose the native platform APIs. Their SAF helpers are
therefore Android-only, while memory and stream helpers are available on their
supported native platforms.
Use ffkitsaf: when an Android user selects a document
through the Storage Access Framework and you need to pass that content:// URI
to FFmpegKit.
Use ffkitmem: when all input bytes are already in
memory or when you want FFmpeg's complete output returned as bytes after the
command finishes.
Use ffkitstream: when bytes are produced or
consumed while FFmpeg is running. Streaming resources are not seekable, so they
fit sequential formats and live pipelines.
The same pattern applies across platforms:
- Create the protocol wrapper.
- Pass
getUrl()or the returned SAF URL to FFmpegKit. - Run the FFmpeg or FFprobe command.
- Read or write data if the wrapper requires it.
- Close the wrapper or unregister the SAF URL when done.
Do not build protocol URLs manually. The numeric ids inside URLs refer to native resources registered by FFmpegKit, and those resources must be created and released through the API.
Copyright (c) 2026 FFmpegKitNext
- Status
- Versions
- Changelog
- Project Layout
- Using
- Building
- External Libraries
- Patents
- License