public class FFprobeKit
extends java.lang.Object
Main class to run FFprobe
commands. Supports executing commands both
synchronously and asynchronously.
FFprobeSession session = FFprobeKit.execute("-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4"); FFprobeSession asyncSession = FFprobeKit.executeAsync("-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4", executeCallback);
Provides overloaded execute
methods to define session specific callbacks.
FFprobeSession session = FFprobeKit.executeAsync("-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4", executeCallback, logCallback);
It can extract media information for a file or a url, using getMediaInformation(String)
method.
MediaInformationSession session = FFprobeKit.getMediaInformation("file1.mp4");
Modifier and Type | Method and Description |
---|---|
static FFprobeSession |
execute(java.lang.String command)
Synchronously executes FFprobe command provided.
|
static FFprobeSession |
execute(java.lang.String[] arguments)
Synchronously executes FFprobe with arguments provided.
|
static FFprobeSession |
executeAsync(java.lang.String[] arguments,
ExecuteCallback executeCallback)
Asynchronously executes FFprobe with arguments provided.
|
static FFprobeSession |
executeAsync(java.lang.String[] arguments,
ExecuteCallback executeCallback,
java.util.concurrent.ExecutorService executorService)
Asynchronously executes FFprobe with arguments provided.
|
static FFprobeSession |
executeAsync(java.lang.String[] arguments,
ExecuteCallback executeCallback,
LogCallback logCallback)
Asynchronously executes FFprobe with arguments provided.
|
static FFprobeSession |
executeAsync(java.lang.String[] arguments,
ExecuteCallback executeCallback,
LogCallback logCallback,
java.util.concurrent.ExecutorService executorService)
Asynchronously executes FFprobe with arguments provided.
|
static FFprobeSession |
executeAsync(java.lang.String command,
ExecuteCallback executeCallback)
Asynchronously executes FFprobe command provided.
|
static FFprobeSession |
executeAsync(java.lang.String command,
ExecuteCallback executeCallback,
java.util.concurrent.ExecutorService executorService)
Asynchronously executes FFprobe command provided.
|
static FFprobeSession |
executeAsync(java.lang.String command,
ExecuteCallback executeCallback,
LogCallback logCallback)
Asynchronously executes FFprobe command provided.
|
static FFprobeSession |
executeAsync(java.lang.String command,
ExecuteCallback executeCallback,
LogCallback logCallback,
java.util.concurrent.ExecutorService executorService)
Asynchronously executes FFprobe command provided.
|
static MediaInformationSession |
getMediaInformation(java.lang.String path)
Extracts media information for the file specified with path.
|
static MediaInformationSession |
getMediaInformation(java.lang.String path,
int waitTimeout)
Extracts media information for the file specified with path.
|
static MediaInformationSession |
getMediaInformationAsync(java.lang.String path,
ExecuteCallback executeCallback)
Extracts media information for the file specified with path asynchronously.
|
static MediaInformationSession |
getMediaInformationAsync(java.lang.String path,
ExecuteCallback executeCallback,
java.util.concurrent.ExecutorService executorService)
Extracts media information for the file specified with path asynchronously.
|
static MediaInformationSession |
getMediaInformationAsync(java.lang.String path,
ExecuteCallback executeCallback,
LogCallback logCallback,
java.util.concurrent.ExecutorService executorService,
int waitTimeout)
Extracts media information for the file specified with path asynchronously.
|
static MediaInformationSession |
getMediaInformationAsync(java.lang.String path,
ExecuteCallback executeCallback,
LogCallback logCallback,
int waitTimeout)
Extracts media information for the file specified with path asynchronously.
|
static MediaInformationSession |
getMediaInformationFromCommand(java.lang.String command)
Extracts media information using the command provided asynchronously.
|
static MediaInformationSession |
getMediaInformationFromCommandAsync(java.lang.String command,
ExecuteCallback executeCallback,
LogCallback logCallback,
int waitTimeout)
Extracts media information using the command provided asynchronously.
|
static java.util.List<FFprobeSession> |
listSessions()
Lists all FFprobe sessions in the session history.
|
public static FFprobeSession execute(java.lang.String[] arguments)
Synchronously executes FFprobe with arguments provided.
arguments
- FFprobe command options/arguments as string arraypublic static FFprobeSession executeAsync(java.lang.String[] arguments, ExecuteCallback executeCallback)
Asynchronously executes FFprobe with arguments provided.
arguments
- FFprobe command options/arguments as string arrayexecuteCallback
- callback that will be called when the execution is completedpublic static FFprobeSession executeAsync(java.lang.String[] arguments, ExecuteCallback executeCallback, LogCallback logCallback)
Asynchronously executes FFprobe with arguments provided.
arguments
- FFprobe command options/arguments as string arrayexecuteCallback
- callback that will be notified when execution is completedlogCallback
- callback that will receive logspublic static FFprobeSession executeAsync(java.lang.String[] arguments, ExecuteCallback executeCallback, java.util.concurrent.ExecutorService executorService)
Asynchronously executes FFprobe with arguments provided.
arguments
- FFprobe command options/arguments as string arrayexecuteCallback
- callback that will be called when the execution is completedexecutorService
- executor service that will be used to run this asynchronous operationpublic static FFprobeSession executeAsync(java.lang.String[] arguments, ExecuteCallback executeCallback, LogCallback logCallback, java.util.concurrent.ExecutorService executorService)
Asynchronously executes FFprobe with arguments provided.
arguments
- FFprobe command options/arguments as string arrayexecuteCallback
- callback that will be notified when execution is completedlogCallback
- callback that will receive logsexecutorService
- executor service that will be used to run this asynchronous operationpublic static FFprobeSession execute(java.lang.String command)
Synchronously executes FFprobe 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
- FFprobe commandpublic static FFprobeSession executeAsync(java.lang.String command, ExecuteCallback executeCallback)
Asynchronously executes FFprobe 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
- FFprobe commandexecuteCallback
- callback that will be called when the execution is completedpublic static FFprobeSession executeAsync(java.lang.String command, ExecuteCallback executeCallback, LogCallback logCallback)
Asynchronously executes FFprobe 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
- FFprobe commandexecuteCallback
- callback that will be notified when execution is completedlogCallback
- callback that will receive logspublic static FFprobeSession executeAsync(java.lang.String command, ExecuteCallback executeCallback, java.util.concurrent.ExecutorService executorService)
Asynchronously executes FFprobe 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
- FFprobe commandexecuteCallback
- callback that will be called when the execution is completedexecutorService
- executor service that will be used to run this asynchronous operationpublic static FFprobeSession executeAsync(java.lang.String command, ExecuteCallback executeCallback, LogCallback logCallback, java.util.concurrent.ExecutorService executorService)
Asynchronously executes FFprobe 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
- FFprobe commandexecuteCallback
- callback that will be called when the execution is completedlogCallback
- callback that will receive logsexecutorService
- executor service that will be used to run this asynchronous operationpublic static MediaInformationSession getMediaInformation(java.lang.String path)
Extracts media information for the file specified with path.
path
- path or uri of a media filepublic static MediaInformationSession getMediaInformation(java.lang.String path, int waitTimeout)
Extracts media information for the file specified with path.
path
- path or uri of a media filewaitTimeout
- max time to wait until media information is transmittedpublic static MediaInformationSession getMediaInformationAsync(java.lang.String path, ExecuteCallback executeCallback)
Extracts media information for the file specified with path asynchronously.
path
- path or uri of a media fileexecuteCallback
- callback that will be called when the execution is completedpublic static MediaInformationSession getMediaInformationAsync(java.lang.String path, ExecuteCallback executeCallback, LogCallback logCallback, int waitTimeout)
Extracts media information for the file specified with path asynchronously.
path
- path or uri of a media fileexecuteCallback
- callback that will be notified when execution is completedlogCallback
- callback that will receive logswaitTimeout
- max time to wait until media information is transmittedpublic static MediaInformationSession getMediaInformationAsync(java.lang.String path, ExecuteCallback executeCallback, java.util.concurrent.ExecutorService executorService)
Extracts media information for the file specified with path asynchronously.
path
- path or uri of a media fileexecuteCallback
- callback that will be called when the execution is completedexecutorService
- executor service that will be used to run this asynchronous operationpublic static MediaInformationSession getMediaInformationAsync(java.lang.String path, ExecuteCallback executeCallback, LogCallback logCallback, java.util.concurrent.ExecutorService executorService, int waitTimeout)
Extracts media information for the file specified with path asynchronously.
path
- path or uri of a media fileexecuteCallback
- callback that will be notified when execution is completedlogCallback
- callback that will receive logsexecutorService
- executor service that will be used to run this asynchronous operationwaitTimeout
- max time to wait until media information is transmittedpublic static MediaInformationSession getMediaInformationFromCommand(java.lang.String command)
Extracts media information using the command provided asynchronously.
command
- FFprobe command that prints media information for a file in JSON formatpublic static MediaInformationSession getMediaInformationFromCommandAsync(java.lang.String command, ExecuteCallback executeCallback, LogCallback logCallback, int waitTimeout)
Extracts media information using the command provided asynchronously.
command
- FFprobe command that prints media information for a file in JSON formatexecuteCallback
- callback that will be notified when execution is completedlogCallback
- callback that will receive logswaitTimeout
- max time to wait until media information is transmittedpublic static java.util.List<FFprobeSession> listSessions()
Lists all FFprobe sessions in the session history.