-
Notifications
You must be signed in to change notification settings - Fork 605
Tips
execute()
and executeAsync()
methods in FFmpegKit
and FFprobeKit
splits a command into arguments by using the space character as a delimiter. If one of your command parameters include a space character inside then it will be split into two parameters and your command execution will fail. To prevent that, wrap that parameter using single or double quotes. Wrapping will prevent the parameter from being split.
Alternatively, you can split your command into arguments yourself and call one of the overloaded execute()
/executeAsync()
methods that accept arguments array.
FFmpegKit
packages specified in Android C++ Dependency Guide include libc++_shared.so
library. If a second library which also includes libc++_shared.so
is added as a dependency, gradle
fails with More than one file was found with OS independent path 'lib/x86/libc++_shared.so'
error message.
You can fix this error by adding the following block into your build.gradle
.
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'
}
}
ffmpeg
requires a valid fontconfig
configuration to render subtitles. Unfortunately, Android
does not include a default fontconfig
configuration. Therefore, if you do not register a font or specify a fontconfig
configuration under Android
, then the burning process will not produce any errors but subtitles won't be burned into your file.
You can overcome this behaviour by registering the fonts under a directory using the FFmpegKitConfig.setFontDirectory
methods or by specifying your own fontconfig
configuration using FFmpegKitConfig.setFontconfigConfigurationPath
.
ffmpeg
requires a valid fontconfig
configuration to render text while using drawtext
filter. As described in #3, Android
does not include a default fontconfig
configuration. So, if you do not register a font or specify a fontconfig
configuration under Android
, then drawtext
filter will fail with the following error.
Cannot find a valid font for the family Sans
Error initializing filter 'drawtext'
Error reinitializing filters!
Failed to inject frame into filter network: No such file or directory
You can overcome this behaviour by registering the fonts under a directory using the FFmpegKitConfig.setFontDirectory
methods or by specifying your own fontconfig
configuration using FFmpegKitConfig.setFontconfigConfigurationPath
.
System fonts on Android
are stored under the /system/fonts
folder. You can use those fonts in your ffmpeg
commands by registering /system/fonts
as a font directory via the FFmpegKitConfig.setFontDirectory
methods.
System fonts on Apple
platforms (iOS
, macOS
, tvOS
) are stored under the /System/Library/Fonts
and/or /System/Library/Fonts/Cache
folders. You can use those fonts in your ffmpeg
commands by registering /System/Library/Fonts
as a font directory via the [FFmpegKitConfig setFontDirectory]
methods.
If you use the caret syntax to define the LTS version in pubspec.yaml
e.g. ffmpeg_kit_flutter: ^4.5.0-LTS
, flutter pub get
may install the non-LTS version of the plugin. You can resolve this by manually editing the pubspec.lock
file and adding -LTS
suffix to the version.
Copyright (c) 2021-2024 FFmpegKit
- Status
- Versions
- Changelog
- Project Layout
- API
- Using
- Building
- External Libraries
- Patents
- License