public class FFmpegKit
extends java.lang.Object
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", completeCallback);
Provides overloaded execute methods to define session specific callbacks.
FFmpegSession asyncSession = FFmpegKit.executeAsync("-i file1.mp4 -c:v libxvid file1.avi", completeCallback, logCallback, statisticsCallback);
| Modifier and Type | Method and Description |
|---|---|
static void |
cancel()
Cancels all running sessions.
|
static void |
cancel(long sessionId)
Cancels the session specified with
sessionId. |
static FFmpegSession |
execute(java.lang.String command)
Synchronously executes FFmpeg command provided.
|
static FFmpegSession |
executeAsync(java.lang.String command,
FFmpegSessionCompleteCallback completeCallback)
Starts an asynchronous FFmpeg execution for the given command.
|
static FFmpegSession |
executeAsync(java.lang.String command,
FFmpegSessionCompleteCallback completeCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFmpeg execution for the given command.
|
static FFmpegSession |
executeAsync(java.lang.String command,
FFmpegSessionCompleteCallback completeCallback,
LogCallback logCallback,
StatisticsCallback statisticsCallback)
Starts an asynchronous FFmpeg execution for the given command.
|
static FFmpegSession |
executeAsync(java.lang.String command,
FFmpegSessionCompleteCallback completeCallback,
LogCallback logCallback,
StatisticsCallback statisticsCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFmpeg execution for the given command.
|
static FFmpegSession |
executeWithArguments(java.lang.String[] arguments)
Synchronously executes FFmpeg with arguments provided.
|
static FFmpegSession |
executeWithArgumentsAsync(java.lang.String[] arguments,
FFmpegSessionCompleteCallback completeCallback)
Starts an asynchronous FFmpeg execution with arguments provided.
|
static FFmpegSession |
executeWithArgumentsAsync(java.lang.String[] arguments,
FFmpegSessionCompleteCallback completeCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFmpeg execution with arguments provided.
|
static FFmpegSession |
executeWithArgumentsAsync(java.lang.String[] arguments,
FFmpegSessionCompleteCallback completeCallback,
LogCallback logCallback,
StatisticsCallback statisticsCallback)
Starts an asynchronous FFmpeg execution with arguments provided.
|
static FFmpegSession |
executeWithArgumentsAsync(java.lang.String[] arguments,
FFmpegSessionCompleteCallback completeCallback,
LogCallback logCallback,
StatisticsCallback statisticsCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFmpeg execution with arguments provided.
|
static java.util.List<FFmpegSession> |
listSessions()
Lists all FFmpeg sessions in the session history.
|
public static FFmpegSession executeWithArguments(java.lang.String[] arguments)
Synchronously executes FFmpeg with arguments provided.
arguments - FFmpeg command options/arguments as string arraypublic static FFmpegSession executeWithArgumentsAsync(java.lang.String[] arguments, FFmpegSessionCompleteCallback completeCallback)
Starts an asynchronous FFmpeg execution with arguments provided.
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.
arguments - FFmpeg command options/arguments as string arraycompleteCallback - callback that will be called when the execution has completedpublic static FFmpegSession executeWithArgumentsAsync(java.lang.String[] arguments, FFmpegSessionCompleteCallback completeCallback, LogCallback logCallback, StatisticsCallback statisticsCallback)
Starts an asynchronous FFmpeg execution with arguments provided.
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.
arguments - FFmpeg command options/arguments as string arraycompleteCallback - callback that will be called when the execution has completedlogCallback - callback that will receive logsstatisticsCallback - callback that will receive statisticspublic static FFmpegSession executeWithArgumentsAsync(java.lang.String[] arguments, FFmpegSessionCompleteCallback completeCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFmpeg execution with arguments provided.
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.
arguments - FFmpeg command options/arguments as string arraycompleteCallback - callback that will be called when the execution has completedexecutorService - executor service that will be used to run this asynchronous operationpublic static FFmpegSession executeWithArgumentsAsync(java.lang.String[] arguments, FFmpegSessionCompleteCallback completeCallback, LogCallback logCallback, StatisticsCallback statisticsCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFmpeg execution with arguments provided.
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.
arguments - FFmpeg command options/arguments as string arraycompleteCallback - callback that will be called when the execution has completedlogCallback - callback that will receive logsstatisticsCallback - callback that will receive statisticsexecutorService - executor service that will be used to run this asynchronous
operationpublic static FFmpegSession execute(java.lang.String 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.
command - FFmpeg commandpublic static FFmpegSession executeAsync(java.lang.String command, FFmpegSessionCompleteCallback completeCallback)
Starts an asynchronous FFmpeg execution for the given command. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command.
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.
command - FFmpeg commandcompleteCallback - callback that will be called when the execution has completedpublic static FFmpegSession executeAsync(java.lang.String command, FFmpegSessionCompleteCallback completeCallback, LogCallback logCallback, StatisticsCallback statisticsCallback)
Starts an asynchronous FFmpeg execution for the given command. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command.
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.
command - FFmpeg commandcompleteCallback - callback that will be called when the execution has completedlogCallback - callback that will receive logsstatisticsCallback - callback that will receive statisticspublic static FFmpegSession executeAsync(java.lang.String command, FFmpegSessionCompleteCallback completeCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFmpeg execution for the given command. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command.
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.
command - FFmpeg commandcompleteCallback - callback that will be called when the execution has completedexecutorService - executor service that will be used to run this asynchronous operationpublic static FFmpegSession executeAsync(java.lang.String command, FFmpegSessionCompleteCallback completeCallback, LogCallback logCallback, StatisticsCallback statisticsCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFmpeg execution for the given command. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command.
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.
command - FFmpeg commandcompleteCallback - callback that will be called when the execution has completedlogCallback - callback that will receive logsstatisticsCallback - callback that will receive statisticsexecutorService - executor service that will be used to run this asynchronous operationpublic static void cancel()
Cancels all running sessions.
This method does not wait for termination to complete and returns immediately.
public static void cancel(long sessionId)
Cancels the session specified with sessionId.
This method does not wait for termination to complete and returns immediately.
sessionId - id of the session that will be cancelledpublic static java.util.List<FFmpegSession> listSessions()
Lists all FFmpeg sessions in the session history.