-
Notifications
You must be signed in to change notification settings - Fork 0
Tips
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[].
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.)
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.
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.
Android's system fonts live under /system/fonts. Register that path directly:
FFmpegKitConfig.setFontDirectoryList(context, Arrays.asList("/system/fonts"), Collections.EMPTY_MAP);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).
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.
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.