Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Concurrent Execution Support

Taner Şener edited this page Jul 26, 2020 · 5 revisions

v4.3.1 introduces concurrent execution support for both FFmpeg and FFprobe. You can start running multiple commands at the same time without waiting other executions to finish.

Return code

For synchronous executions, return code returned by the method call represents the completion status of that command. On async API methods, ExecuteCallback interface on Android and ExecuteDelegate on iOS/tvOS includes returnCode field, which carries the completion status.

Cancel

cancel() method can be used to cancel all ongoing executions. If you need to cancel a specific execution, start a new execution using the new Async API introduced in v4.4, get the executionId of that execution and invoke the cancel method with that id.

  • Android

    long executionId = FFmpeg.executeAsync(ffmpegCommand, ...);
    FFmpeg.cancel(executionId);
    
  • iOS/tvOS

    long executionId = [MobileFFmpeg executeAsync:ffmpegCommand withCallback:self];
    [MobileFFmpeg cancel:executionId];
    

Command Output

LoCallback interface on Android and ExecuteDelegate on iOS/tvOS includes executionId field. You can identify which log call belongs to which execution by looking at the value of that field. Note that for synchronous executions executionId is always 0.

Unfortunately, Config.getLastCommandOutput() method does not support concurrent executions. It returns output from all commands being executed at that moment.

Clone this wiki locally