Skip to content

Concurrency and Logs in Native APIs

Taner Sener edited this page Nov 9, 2024 · 1 revision

Logs in FFmpegKit are linked to the thread that runs them, with each log tied to a specific thread. If you run multiple sessions on the same thread at the same time, there will be logging issues because FFmpegKit will send the logs from both sessions to only the latest session's callback.

The default executeAsync() methods handle threads automatically to avoid this problem. But if you use your own thread pool (ExecutorService in Android, Dispatch Queue on Apple platforms) with executeAsync() or use execute(), you might run into this issue. To prevent it, ensure each session runs on a different thread.

This behavior affects all FFmpegKit Native APIs (Android, iOS, macOS, tvOS), including version 6.0. However, hybrid platforms like Flutter and React Native don’t have this issue, as their plugins manage threads automatically.

Clone this wiki locally