| FFmpegKit iOS / macOS / tvOS API 6.0

Loading...
Searching...
No Matches
Class Methods
FFmpegKitConfig Class Reference

`#import <FFmpegKitConfig.h>`

## Class Methods
(void) | + enableRedirection
(void) | + disableRedirection
(int) | + setFontconfigConfigurationPath:
(void) | + setFontDirectory:with:
(void) | + setFontDirectoryList:with:
(NSString *) | + registerNewFFmpegPipe
(void) | + closeFFmpegPipe:
(NSString *) | + getFFmpegVersion
(NSString *) | + getVersion
(int) | + isLTSBuild
(NSString *) | + getBuildDate
(int) | + setEnvironmentVariable:value:
(void) | + ignoreSignal:
(void) | + ffmpegExecute:
(void) | + ffprobeExecute:
(void) | + getMediaInformationExecute:withTimeout:
(void) | + asyncFFmpegExecute:
(void) | + asyncFFmpegExecute:onDispatchQueue:
(void) | + asyncFFprobeExecute:
(void) | + asyncFFprobeExecute:onDispatchQueue:
(void) | + asyncGetMediaInformationExecute:withTimeout:
(void) | + asyncGetMediaInformationExecute:onDispatchQueue:withTimeout:
(void) | + enableLogCallback:
(void) | + enableStatisticsCallback:
(void) | + enableFFmpegSessionCompleteCallback:
(FFmpegSessionCompleteCallback) | + getFFmpegSessionCompleteCallback
(void) | + enableFFprobeSessionCompleteCallback:
(FFprobeSessionCompleteCallback) | + getFFprobeSessionCompleteCallback
(void) | + enableMediaInformationSessionCompleteCallback:
(MediaInformationSessionCompleteCallback) | + getMediaInformationSessionCompleteCallback
(int) | + getLogLevel
(void) | + setLogLevel:
(NSString *) | + logLevelToString:
(int) | + getSessionHistorySize
(void) | + setSessionHistorySize:
(id< Session >) | + getSession:
(id< Session >) | + getLastSession
(id< Session >) | + getLastCompletedSession
(NSArray *) | + getSessions
(void) | + clearSessions
(NSArray *) | + getFFmpegSessions
(NSArray *) | + getFFprobeSessions
(NSArray *) | + getMediaInformationSessions
(NSArray *) | + getSessionsByState:
(LogRedirectionStrategy) | + getLogRedirectionStrategy
(void) | + setLogRedirectionStrategy:
(int) | + messagesInTransmit:
(NSString *) | + sessionStateToString:
(NSArray *) | + parseArguments:
(NSString *) | + argumentsToString:
(void) | + initialize`[implementation]`

## Detailed Description

Configuration class of `FFmpegKit` library. Allows customizing the global library options. Provides helper methods to support additional resources.

Definition at line 48 of file FFmpegKitConfig.h.

## Method Documentation

## ◆ argumentsToString:

+ (NSString *) argumentsToString: |  | (NSArray*) | arguments |

Concatenates arguments into a string adding a space character between two arguments.

Parameters

  arguments | arguments

Returns
  concatenated string containing all arguments

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ asyncFFmpegExecute:

+ (void) asyncFFmpegExecute: |  | (FFmpegSession*) | ffmpegSession |

Starts an asynchronous FFmpeg execution for the given session.

Note that this method returns immediately and does not wait the execution to complete. You must use an FFmpegSessionCompleteCallback if you want to be notified about the result.

Parameters

  ffmpegSession | FFmpeg session which includes command options/arguments

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ asyncFFmpegExecute:onDispatchQueue:

+ (void) asyncFFmpegExecute: |  | (FFmpegSession*) | ffmpegSession
onDispatchQueue: |  | (dispatch_queue_t) | queue

Starts an asynchronous FFmpeg execution for the given session.

Note that this method returns immediately and does not wait the execution to complete. You must use an FFmpegSessionCompleteCallback if you want to be notified about the result.

Parameters

  ffmpegSession | FFmpeg session which includes command options/arguments
  queue | dispatch queue that will be used to run this asynchronous operation

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ asyncFFprobeExecute:

+ (void) asyncFFprobeExecute: |  | (FFprobeSession*) | ffprobeSession |

Starts an asynchronous FFprobe execution for the given session.

Note that this method returns immediately and does not wait the execution to complete. You must use an FFprobeSessionCompleteCallback if you want to be notified about the result.

Parameters

  ffprobeSession | FFprobe session which includes command options/arguments

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ asyncFFprobeExecute:onDispatchQueue:

+ (void) asyncFFprobeExecute: |  | (FFprobeSession*) | ffprobeSession
onDispatchQueue: |  | (dispatch_queue_t) | queue

Starts an asynchronous FFprobe execution for the given session.

Note that this method returns immediately and does not wait the execution to complete. You must use an FFprobeSessionCompleteCallback if you want to be notified about the result.

Parameters

  ffprobeSession | FFprobe session which includes command options/arguments
  queue | dispatch queue that will be used to run this asynchronous operation

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ asyncGetMediaInformationExecute:onDispatchQueue:withTimeout:

+ (void) asyncGetMediaInformationExecute: |  | (MediaInformationSession*) | mediaInformationSession
onDispatchQueue: |  | (dispatch_queue_t) | queue
withTimeout: |  | (int) | waitTimeout

Starts an asynchronous FFprobe execution for the given media information session.

Note that this method returns immediately and does not wait the execution to complete. You must use an MediaInformationSessionCompleteCallback if you want to be notified about the result.

Parameters

  mediaInformationSession | media information session which includes command options/arguments
  queue | dispatch queue that will be used to run this asynchronous operation
  waitTimeout | max time to wait until media information is transmitted

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ asyncGetMediaInformationExecute:withTimeout:

+ (void) asyncGetMediaInformationExecute: |  | (MediaInformationSession*) | mediaInformationSession
withTimeout: |  | (int) | waitTimeout

Starts an asynchronous FFprobe execution for the given media information session.

Note that this method returns immediately and does not wait the execution to complete. You must use an MediaInformationSessionCompleteCallback if you want to be notified about the result.

Parameters

  mediaInformationSession | media information session which includes command options/arguments
  waitTimeout | max time to wait until media information is transmitted

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ clearSessions

+ (void) clearSessions |  |  |

Clears all, including ongoing, sessions in the session history.

Note that callbacks cannot be triggered for deleted sessions.

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ closeFFmpegPipe:

+ (void) closeFFmpegPipe: |  | (NSString*) | ffmpegPipePath |

Closes a previously created `FFmpeg` pipe.

Parameters

  ffmpegPipePath | full path of the FFmpeg pipe

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ disableRedirection

+ (void) disableRedirection |  |  |

Disables log and statistics redirection.

When redirection is disabled logs are printed to stderr, all logs and statistics callbacks are disabled and `FFprobe`'s `getMediaInformation` methods do not work.

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ enableFFmpegSessionCompleteCallback:

+ (void) enableFFmpegSessionCompleteCallback: |  | (FFmpegSessionCompleteCallback) | ffmpegSessionCompleteCallback |

Sets a global FFmpegSessionCompleteCallback to receive execution results for FFmpeg sessions.

Parameters

  ffmpegSessionCompleteCallback | complete callback or nil to disable a previously defined callback

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ enableFFprobeSessionCompleteCallback:

+ (void) enableFFprobeSessionCompleteCallback: |  | (FFprobeSessionCompleteCallback) | ffprobeSessionCompleteCallback |

Sets a global FFprobeSessionCompleteCallback to receive execution results for FFprobe sessions.

Parameters

  ffprobeSessionCompleteCallback | complete callback or nil to disable a previously defined callback

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ enableLogCallback:

+ (void) enableLogCallback: |  | (LogCallback) | logCallback |

Sets a global log callback to redirect FFmpeg/FFprobe logs.

Parameters

  logCallback | log callback or nil to disable a previously defined log callback

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ enableMediaInformationSessionCompleteCallback:

+ (void) enableMediaInformationSessionCompleteCallback: |  | (MediaInformationSessionCompleteCallback) | mediaInformationSessionCompleteCallback |

Sets a global MediaInformationSessionCompleteCallback to receive execution results for MediaInformation sessions.

Parameters

  mediaInformationSessionCompleteCallback | complete callback or nil to disable a previously defined callback

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ enableRedirection

+ (void) enableRedirection |  |  |

Enables log and statistics redirection.

When redirection is enabled FFmpeg/FFprobe logs are redirected to NSLog and sessions collect log and statistics entries for the executions. It is possible to define global or session specific log/statistics callbacks as well.

Note that redirection is enabled by default. If you do not want to use its functionality please use disableRedirection method to disable it.

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ enableStatisticsCallback:

+ (void) enableStatisticsCallback: |  | (StatisticsCallback) | statisticsCallback |

Sets a global statistics callback to redirect FFmpeg statistics.

Parameters

  statisticsCallback | statistics callback or nil to disable a previously defined statistics callback

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ ffmpegExecute:

+ (void) ffmpegExecute: |  | (FFmpegSession*) | ffmpegSession |

Synchronously executes the FFmpeg session provided.

Parameters

  ffmpegSession | FFmpeg session which includes command options/arguments

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ ffprobeExecute:

+ (void) ffprobeExecute: |  | (FFprobeSession*) | ffprobeSession |

Synchronously executes the FFprobe session provided.

Parameters

  ffprobeSession | FFprobe session which includes command options/arguments

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getBuildDate

+ (NSString *) getBuildDate |  |  |

Returns FFmpegKit library build date.

Returns
  FFmpegKit library build date

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getFFmpegSessionCompleteCallback

+ (FFmpegSessionCompleteCallback) getFFmpegSessionCompleteCallback |  |  |

Returns the global FFmpegSessionCompleteCallback set.

Returns
  global FFmpegSessionCompleteCallback or nil if it is not set

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getFFmpegSessions

+ (NSArray *) getFFmpegSessions |  |  |

Returns all FFmpeg sessions in the session history.

Returns
  all FFmpeg sessions in the session history

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getFFmpegVersion

+ (NSString *) getFFmpegVersion |  |  |

Returns the version of FFmpeg bundled within `FFmpegKit` library.

Returns
  the version of FFmpeg

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getFFprobeSessionCompleteCallback

+ (FFprobeSessionCompleteCallback) getFFprobeSessionCompleteCallback |  |  |

Returns the global FFprobeSessionCompleteCallback set.

Returns
  global FFprobeSessionCompleteCallback or nil if it is not set

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getFFprobeSessions

+ (NSArray *) getFFprobeSessions |  |  |

Returns all FFprobe sessions in the session history.

Returns
  all FFprobe sessions in the session history

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getLastCompletedSession

+ (id< Session >) getLastCompletedSession |  |  |

Returns the last session completed from the session history.

Returns
  the last session completed. If there are no completed sessions in the history this method will return nil

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getLastSession

+ (id< Session >) getLastSession |  |  |

Returns the last session created from the session history.

Returns
  the last session created or nil if session history is empty

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getLogLevel

+ (int) getLogLevel |  |  |

Returns the current log level.

Returns
  current log level

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getLogRedirectionStrategy

+ (LogRedirectionStrategy) getLogRedirectionStrategy |  |  |

Returns the active log redirection strategy.

Returns
  log redirection strategy

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getMediaInformationExecute:withTimeout:

+ (void) getMediaInformationExecute: |  | (MediaInformationSession*) | mediaInformationSession
withTimeout: |  | (int) | waitTimeout

Synchronously executes the media information session provided.

Parameters

  mediaInformationSession | media information session which includes command options/arguments
  waitTimeout | max time to wait until media information is transmitted

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getMediaInformationSessionCompleteCallback

+ (MediaInformationSessionCompleteCallback) getMediaInformationSessionCompleteCallback |  |  |

Returns the global MediaInformationSessionCompleteCallback set.

Returns
  global MediaInformationSessionCompleteCallback or nil if it is not set

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getMediaInformationSessions

+ (NSArray *) getMediaInformationSessions |  |  |

Returns all MediaInformation sessions in the session history.

Returns
  all MediaInformation sessions in the session history

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getSession:

+ (id< Session >) getSession: |  | (long) | sessionId |

Returns the session specified with `sessionId` from the session history.

Parameters

  sessionId | session identifier

Returns
  session specified with sessionId or nil if it is not found in the history

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getSessionHistorySize

+ (int) getSessionHistorySize |  |  |

Returns the session history size.

Returns
  session history size

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getSessions

+ (NSArray *) getSessions |  |  |

Returns all sessions in the session history.

Returns
  all sessions in the session history

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getSessionsByState:

+ (NSArray *) getSessionsByState: |  | (SessionState) | state |

Returns sessions that have the given state.

Returns
  sessions that have the given state from the session history

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ getVersion

+ (NSString *) getVersion |  |  |

Returns FFmpegKit library version.

Returns
  FFmpegKit version

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ ignoreSignal:

+ (void) ignoreSignal: |  | (Signal) | signal |

Registers a new ignored signal. Ignored signals are not handled by `FFmpegKit` library.

Parameters

  signal | signal to be ignored

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ initialize

+ (void) initialize |  |  |
| implementation

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ isLTSBuild

+ (int) isLTSBuild |  |  |

Returns whether FFmpegKit release is a Long Term Release or not.

Returns
  true/yes or false/no

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ logLevelToString:

+ (NSString *) logLevelToString: |  | (int) | level |

Converts int log level to string.

Parameters

  level | value

Returns
  string value

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ messagesInTransmit:

+ (int) messagesInTransmit: |  | (long) | sessionId |

Returns the number of async messages that are not transmitted to the callbacks for this session.

Parameters

  sessionId | id of the session

Returns
  number of async messages that are not transmitted to the callbacks for this session

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ parseArguments:

+ (NSArray *) parseArguments: |  | (NSString*) | command |

Parses the given command into arguments. Uses space character to split the arguments. Supports single and double quote characters.

Parameters

  command | string command

Returns
  array of arguments

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ registerNewFFmpegPipe

+ (NSString *) registerNewFFmpegPipe |  |  |

Creates a new named pipe to use in `FFmpeg` operations.

Please note that creator is responsible of closing created pipes.

Returns
  the full path of the named pipe

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ sessionStateToString:

+ (NSString *) sessionStateToString: |  | (SessionState) | state |

Converts session state to string.

Parameters

  state | session state

Returns
  string value

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ setEnvironmentVariable:value:

+ (int) setEnvironmentVariable: |  | (NSString*) | variableName
value: |  | (NSString*) | variableValue

Sets an environment variable.

Parameters

  variableName | environment variable name
  variableValue | environment variable value

Returns
  zero on success, non-zero on error

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ setFontconfigConfigurationPath:

+ (int) setFontconfigConfigurationPath: |  | (NSString*) | path |

Sets and overrides `fontconfig` configuration directory.

Parameters

  path | directory that contains fontconfig configuration (fonts.conf)

Returns
  zero on success, non-zero on error

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ setFontDirectory:with:

+ (void) setFontDirectory: |  | (NSString*) | fontDirectoryPath
with: |  | (NSDictionary*) | fontNameMapping

Registers the fonts inside the given path, so they become available to use in FFmpeg filters.

Note that you need to build `FFmpegKit` with `fontconfig` enabled or use a prebuilt package with `fontconfig` inside to be able to use fonts in `FFmpeg`.

Parameters

  fontDirectoryPath | directory that contains fonts (.ttf and .otf files)
  fontNameMapping | custom font name mappings, useful to access your fonts with more friendly names

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ setFontDirectoryList:with:

+ (void) setFontDirectoryList: |  | (NSArray*) | fontDirectoryList
with: |  | (NSDictionary*) | fontNameMapping

Registers the fonts inside the given array of font directories, so they become available to use in FFmpeg filters.

Note that you need to build `FFmpegKit` with `fontconfig` enabled or use a prebuilt package with `fontconfig` inside to be able to use fonts in `FFmpeg`.

Parameters

  fontDirectoryList | array of directories that contain fonts (.ttf and .otf files)
  fontNameMapping | custom font name mappings, useful to access your fonts with more friendly names

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ setLogLevel:

+ (void) setLogLevel: |  | (int) | level |

Sets the log level.

Parameters

  level | new log level

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ setLogRedirectionStrategy:

+ (void) setLogRedirectionStrategy: |  | (LogRedirectionStrategy) | logRedirectionStrategy |

Sets the log redirection strategy

Parameters

  logRedirectionStrategy | log redirection strategy

Definition at line 155 of file FFmpegKitConfig.m.

## ◆ setSessionHistorySize:

+ (void) setSessionHistorySize: |  | (int) | sessionHistorySize |

Sets the session history size.

Parameters

  sessionHistorySize | session history size, should be smaller than 1000

Definition at line 155 of file FFmpegKitConfig.m.

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

- FFmpegKitConfig.h
- FFmpegKitConfig.m