Skip to content
ffmpegkit-maintained edited this page Jun 23, 2026 · 1 revision

Tips

1. Spaces inside a command argument

execute()/executeAsync() split a command string into arguments on spaces. A parameter containing a space gets split into two arguments and your command fails. Wrap it in quotes:

FFmpegKit.execute("-i \"my file.mp4\" -c:v mpeg4 output.mp4");

Or skip splitting entirely and call the executeWithArguments()/executeWithArgumentsAsync() overloads with a pre-built String[].

2. Conflicting libc++_shared.so from another library

If another Android library you depend on also bundles libc++_shared.so, Gradle fails with:

More than one file was found with OS independent path 'lib/x86/libc++_shared.so'

Fix it with:

android {
    packagingOptions {
        pickFirst 'lib/x86/libc++_shared.so'
        pickFirst 'lib/x86_64/libc++_shared.so'
        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
        pickFirst 'lib/arm64-v8a/libc++_shared.so'
    }
}

(Only arm64-v8a is published by this fork, but the other entries are harmless to keep if your project still references them.)

3. Subtitles don't get burned in, no error

ffmpeg needs a fontconfig configuration to render subtitles, and Android doesn't ship one. Without registering a font directory, subtitle-burning commands succeed but produce no visible subtitles. Fix with FFmpegKitConfig.setFontDirectoryList() — see API Usage § Fonts.

4. drawtext filter fails

Same root cause as #3, but drawtext fails loudly instead of silently:

Cannot find a valid font for the family Sans
Error initializing filter 'drawtext'

Same fix: register a font directory first.

5. Using system fonts

Android's system fonts live under /system/fonts. Register that path directly:

FFmpegKitConfig.setFontDirectoryList(context, Arrays.asList("/system/fonts"), Collections.EMPTY_MAP);

6. UDP streaming doesn't work

Android's pthreads implementation lacks a component ffmpeg's udp module needs. A UDP connection attempt prints:

[udp @ 0x...] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)

and transmits nothing. There's no workaround — use tcp instead (e.g. -rtsp_transport tcp).

7. drawtext filter / No such filter: 'drawtext'

drawtext depends on freetype (and fontconfig for actual font usage). The Free and Basic tiers don't include the subtitle/text rendering stack — see Compatibility for the tier breakdown — so commands using drawtext or subtitle burn-in need Full or Full GPL.

8. A filter or codec isn't available

Before assuming something's broken, check whether your tier actually includes it — see Compatibility and GPL Filters. The four tiers deliberately include different codec/filter sets.

Clone this wiki locally