| FFmpegKit iOS / macOS / tvOS API 4.5

Class Methods
FFmpegKit Class Reference

`#import <FFmpegKit.h>`

## Class Methods
(FFmpegSession *) | + executeWithArguments:
(FFmpegSession *) | + executeWithArgumentsAsync:withExecuteCallback:
(FFmpegSession *) | + executeWithArgumentsAsync:withExecuteCallback:withLogCallback:withStatisticsCallback:
(FFmpegSession *) | + executeWithArgumentsAsync:withExecuteCallback:onDispatchQueue:
(FFmpegSession *) | + executeWithArgumentsAsync:withExecuteCallback:withLogCallback:withStatisticsCallback:onDispatchQueue:
(FFmpegSession *) | + execute:
(FFmpegSession *) | + executeAsync:withExecuteCallback:
(FFmpegSession *) | + executeAsync:withExecuteCallback:withLogCallback:withStatisticsCallback:
(FFmpegSession *) | + executeAsync:withExecuteCallback:onDispatchQueue:
(FFmpegSession *) | + executeAsync:withExecuteCallback:withLogCallback:withStatisticsCallback:onDispatchQueue:
(void) | + cancel
(void) | + cancel:
(NSArray *) | + listSessions
(void) | + initialize`[implementation]`

## Detailed Description

Main class to run `FFmpeg` commands. Supports executing commands both synchronously and asynchronously.

    FFmpegSession *session = [FFmpegKit execute:"-i file1.mp4 -c:v libxvid file1.avi"];

    FFmpegSession *asyncSession = [FFmpegKit executeAsync:@"-i file1.mp4 -c:v libxvid file1.avi" withExecuteCallback:executeCallback];
    </pre>
    <p>Provides overloaded <code>execute</code> methods to define session specific callbacks.
    <pre>
    FFmpegSession *asyncSession = [FFmpegKit executeAsync:@"-i file1.mp4 -c:v libxvid file1.avi" withExecuteCallback:executeCallback withLogCallback:logCallback withStatisticsCallback:statisticsCallback];

Definition at line 44 of file FFmpegKit.h.

## Method Documentation

## ◆ cancel

+ (void) cancel |  |  |

Cancels all running sessions.

This function does not wait for termination to complete and returns immediately.

Definition at line 1 of file FFmpegKit.m.

## ◆ cancel:

+ (void) cancel: |  | (long) | sessionId |

Cancels the session specified with `sessionId`.

This function does not wait for termination to complete and returns immediately.

Parameters

  sessionId | id of the session that will be cancelled

Definition at line 1 of file FFmpegKit.m.

## ◆ execute:

+ (FFmpegSession *) execute: |  | (NSString*) | command |

Synchronously executes FFmpeg command provided. Space character is used to split command into arguments. You can use single or double quote characters to specify arguments inside your command.

Parameters

  command | FFmpeg command

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeAsync:withExecuteCallback:

+ (FFmpegSession *) executeAsync: |  | (NSString*) | command
withExecuteCallback: |  | (ExecuteCallback) | executeCallback

Asynchronously executes FFmpeg command provided. Space character is used to split command into arguments. You can use single or double quote characters to specify arguments inside your command.

Parameters

  command | FFmpeg command
  executeCallback | callback that will be called when the execution is completed

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeAsync:withExecuteCallback:onDispatchQueue:

+ (FFmpegSession *) executeAsync: |  | (NSString*) | command
withExecuteCallback: |  | (ExecuteCallback) | executeCallback
onDispatchQueue: |  | (dispatch_queue_t) | queue

Asynchronously executes FFmpeg command provided. Space character is used to split command into arguments. You can use single or double quote characters to specify arguments inside your command.

Parameters

  command | FFmpeg command
  executeCallback | callback that will be called when the execution is completed
  queue | dispatch queue that will be used to run this asynchronous operation

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeAsync:withExecuteCallback:withLogCallback:withStatisticsCallback:

+ (FFmpegSession *) executeAsync: |  | (NSString*) | command
withExecuteCallback: |  | (ExecuteCallback) | executeCallback
withLogCallback: |  | (LogCallback) | logCallback
withStatisticsCallback: |  | (StatisticsCallback) | statisticsCallback

Asynchronously executes FFmpeg command provided. Space character is used to split command into arguments. You can use single or double quote characters to specify arguments inside your command.

Parameters

  command | FFmpeg command
  executeCallback | callback that will be called when the execution is completed
  logCallback | callback that will receive logs
  statisticsCallback | callback that will receive statistics

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeAsync:withExecuteCallback:withLogCallback:withStatisticsCallback:onDispatchQueue:

+ (FFmpegSession *) executeAsync: |  | (NSString*) | command
withExecuteCallback: |  | (ExecuteCallback) | executeCallback
withLogCallback: |  | (LogCallback) | logCallback
withStatisticsCallback: |  | (StatisticsCallback) | statisticsCallback
onDispatchQueue: |  | (dispatch_queue_t) | queue

Asynchronously executes FFmpeg command provided. Space character is used to split command into arguments. You can use single or double quote characters to specify arguments inside your command.

Parameters

  command | FFmpeg command
  executeCallback | callback that will be called when the execution is completed
  logCallback | callback that will receive logs
  statisticsCallback | callback that will receive statistics
  queue | dispatch queue that will be used to run this asynchronous operation

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeWithArguments:

+ (FFmpegSession *) executeWithArguments: |  | (NSArray*) | arguments |

Synchronously executes FFmpeg with arguments provided.

Parameters

  arguments | FFmpeg command options/arguments as string array

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeWithArgumentsAsync:withExecuteCallback:

+ (FFmpegSession *) executeWithArgumentsAsync: |  | (NSArray*) | arguments
withExecuteCallback: |  | (ExecuteCallback) | executeCallback

Asynchronously executes FFmpeg with arguments provided.

Parameters

  arguments | FFmpeg command options/arguments as string array
  executeCallback | callback that will be called when the execution is completed

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeWithArgumentsAsync:withExecuteCallback:onDispatchQueue:

+ (FFmpegSession *) executeWithArgumentsAsync: |  | (NSArray*) | arguments
withExecuteCallback: |  | (ExecuteCallback) | executeCallback
onDispatchQueue: |  | (dispatch_queue_t) | queue

Asynchronously executes FFmpeg with arguments provided.

Parameters

  arguments | FFmpeg command options/arguments as string array
  executeCallback | callback that will be called when the execution is completed
  queue | dispatch queue that will be used to run this asynchronous operation

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeWithArgumentsAsync:withExecuteCallback:withLogCallback:withStatisticsCallback:

+ (FFmpegSession *) executeWithArgumentsAsync: |  | (NSArray*) | arguments
withExecuteCallback: |  | (ExecuteCallback) | executeCallback
withLogCallback: |  | (LogCallback) | logCallback
withStatisticsCallback: |  | (StatisticsCallback) | statisticsCallback

Asynchronously executes FFmpeg with arguments provided.

Parameters

  arguments | FFmpeg command options/arguments as string array
  executeCallback | callback that will be called when the execution is completed
  logCallback | callback that will receive logs
  statisticsCallback | callback that will receive statistics

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ executeWithArgumentsAsync:withExecuteCallback:withLogCallback:withStatisticsCallback:onDispatchQueue:

+ (FFmpegSession *) executeWithArgumentsAsync: |  | (NSArray*) | arguments
withExecuteCallback: |  | (ExecuteCallback) | executeCallback
withLogCallback: |  | (LogCallback) | logCallback
withStatisticsCallback: |  | (StatisticsCallback) | statisticsCallback
onDispatchQueue: |  | (dispatch_queue_t) | queue

Asynchronously executes FFmpeg with arguments provided.

Parameters

  arguments | FFmpeg command options/arguments as string array
  executeCallback | callback that will be called when the execution is completed
  logCallback | callback that will receive logs
  statisticsCallback | callback that will receive statistics
  queue | dispatch queue that will be used to run this asynchronous operation

Returns
  FFmpeg session created for this execution

Definition at line 1 of file FFmpegKit.m.

## ◆ initialize

+ (void) initialize |  |  |
| implementation

Definition at line 1 of file FFmpegKit.m.

## ◆ listSessions

+ (NSArray *) listSessions |  |  |

Lists all FFmpeg sessions in the session history.

Returns
  all FFmpeg sessions in the session history

Definition at line 1 of file FFmpegKit.m.

The documentation for this class was generated from the following files:

- FFmpegKit.h
- FFmpegKit.m