@capgo/capacitor-ffmpeg

May 11, 2026 ยท View on GitHub

Capgo - Instant updates for Capacitor

โžก๏ธ Get Instant updates for your App with Capgo

Missing a feature? Weโ€™ll build the plugin for you ๐Ÿ’ช

This plugin exposes FFmpeg capabilities to Capacitor. The implementation is still early, and the supported feature set is intentionally smaller than upstream FFmpeg.

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/ffmpeg/

Project roadmap: ROADMAP.md Feature matrix: FEATURE_MATRIX.md Fixture strategy: test/fixtures/README.md Test inventory: test/TEST_INVENTORY.md

Compatibility

Plugin versionCapacitor compatibilityMaintained
v8.*.*v8.*.*โœ…
v7.*.*v7.*.*On demand
v6.*.*v6.*.*โŒ
v5.*.*v5.*.*โŒ

Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.

Install

bun add @capgo/capacitor-ffmpeg
bunx cap sync

Supported today

CapabilityiOSAndroidWebNotes
getCapabilitiesโœ…โœ…โœ…Returns the runtime capability matrix so apps can check what is actually usable on the current platform.
getPluginVersionโœ…โœ…โœ…Returns a { version } payload on every platform; use getCapabilities().platform for platform detection.
reencodeVideoโš ๏ธ ExperimentalโŒโŒiOS accepts a queued job and reports lifecycle via progress; Android and web reject with UNIMPLEMENTED.
convertImageโœ…โœ…โŒiOS converts still images to jpeg or png; Android converts to webp, jpeg, or png; web rejects.
convertAudioโœ…โŒโŒiOS converts audio to m4a; Android and web reject with UNIMPLEMENTED.

Platform status

PlatformStatusNotes
iOSEarly implementationCurrent reference platform for media work.
AndroidPartial native implementationconvertImage is native; the broader FFmpeg media engine and convertAudio still need to be implemented.
WebStub onlyMedia operations are intentionally unsupported right now.

API

getCapabilities()

getCapabilities() => Promise<FFmpegCapabilitiesResult>

Return the machine-readable capability matrix for the current platform.

Returns: Promise<FFmpegCapabilitiesResult>


reencodeVideo(...)

reencodeVideo(options: ReencodeVideoOptions) => Promise<FFmpegAcceptedJob>

Queue a video re-encode job.

On iOS, the returned promise resolves when the native layer accepts the job. Final success or failure is delivered through the progress listener.

Android and web currently reject with UNIMPLEMENTED.

ParamType
optionsReencodeVideoOptions

Returns: Promise<FFmpegAcceptedJob>


convertImage(...)

convertImage(options: ConvertImageOptions) => Promise<ConvertImageResult>

Convert a still image into another format.

iOS currently supports jpeg and png. Android currently supports webp, jpeg, and png. Web currently rejects with UNIMPLEMENTED.

ParamType
optionsConvertImageOptions

Returns: Promise<ConvertImageResult>


convertAudio(...)

convertAudio(options: ConvertAudioOptions) => Promise<ConvertAudioResult>

Convert audio into another container or codec.

iOS currently supports m4a. Android and web currently reject with UNIMPLEMENTED.

ParamType
optionsConvertAudioOptions

Returns: Promise<ConvertAudioResult>


addListener('progress', ...)

addListener(eventName: 'progress', listenerFunc: (event: FFmpegProgressEvent) => void) => Promise<PluginListenerHandle>

Listen for media job progress.

ParamType
eventName'progress'
listenerFunc(event: FFmpegProgressEvent) => void

Returns: Promise<PluginListenerHandle>


getPluginVersion()

getPluginVersion() => Promise<PluginVersionResult>

Get the plugin package version reported by the current platform implementation.

Returns: Promise<PluginVersionResult>


Interfaces

FFmpegCapabilitiesResult

PropType
platformstring
featuresFFmpegCapabilitiesFeatures

FFmpegCapabilitiesFeatures

PropType
getPluginVersionFFmpegCapability
getCapabilitiesFFmpegCapability
reencodeVideoFFmpegCapability
convertImageFFmpegCapability
convertAudioFFmpegCapability
progressEventsFFmpegCapability
probeMediaFFmpegCapability
generateThumbnailFFmpegCapability
extractAudioFFmpegCapability
remuxFFmpegCapability
trimFFmpegCapability

FFmpegCapability

PropType
statusFFmpegCapabilityStatus
reasonstring

FFmpegAcceptedJob

PropType
jobIdstring
status'queued'

ReencodeVideoOptions

PropType
inputPathstring
outputPathstring
widthnumber
heightnumber
bitratenumber

ConvertImageResult

PropType
outputPathstring
formatImageOutputFormat

ConvertImageOptions

PropTypeDescription
inputPathstring
outputPathstring
formatImageOutputFormat
qualitynumberCompression quality in the inclusive range 0.0..1.0. Native platforms reject values outside that range.

ConvertAudioResult

PropType
outputPathstring
formatAudioOutputFormat

ConvertAudioOptions

PropType
inputPathstring
outputPathstring
formatAudioOutputFormat

PluginListenerHandle

PropType
remove() => Promise<void>

FFmpegProgressEvent

PropTypeDescription
jobIdstring
progressnumberNormalized progress as a floating-point value in the inclusive range 0.0..1.0.
stateFFmpegProgressState
messagestring
outputPathstring
fileIdstringLegacy alias kept for compatibility while callers migrate to jobId.

PluginVersionResult

PropType
versionstring

Type Aliases

FFmpegCapabilityStatus

'available' | 'experimental' | 'unimplemented' | 'unavailable'

ImageOutputFormat

'webp' | 'jpeg' | 'png'

AudioOutputFormat

'm4a'

FFmpegProgressState

'running' | 'completed' | 'failed'