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", completeCallback);
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", completeCallback, 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 |
executeAsync(java.lang.String command,
FFprobeSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution for the given command.
|
static FFprobeSession |
executeAsync(java.lang.String command,
FFprobeSessionCompleteCallback completeCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe execution for the given command.
|
static FFprobeSession |
executeAsync(java.lang.String command,
FFprobeSessionCompleteCallback completeCallback,
LogCallback logCallback)
Starts an asynchronous FFprobe execution for the given command.
|
static FFprobeSession |
executeAsync(java.lang.String command,
FFprobeSessionCompleteCallback completeCallback,
LogCallback logCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe execution for the given command.
|
static FFprobeSession |
executeWithArguments(java.lang.String[] arguments)
Synchronously executes FFprobe with arguments provided.
|
static FFprobeSession |
executeWithArgumentsAsync(java.lang.String[] arguments,
FFprobeSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution with arguments provided.
|
static FFprobeSession |
executeWithArgumentsAsync(java.lang.String[] arguments,
FFprobeSessionCompleteCallback completeCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe execution with arguments provided.
|
static FFprobeSession |
executeWithArgumentsAsync(java.lang.String[] arguments,
FFprobeSessionCompleteCallback completeCallback,
LogCallback logCallback)
Starts an asynchronous FFprobe execution with arguments provided.
|
static FFprobeSession |
executeWithArgumentsAsync(java.lang.String[] arguments,
FFprobeSessionCompleteCallback completeCallback,
LogCallback logCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe execution with arguments 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,
MediaInformationSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution to extract the media information for the
specified file.
|
static MediaInformationSession |
getMediaInformationAsync(java.lang.String path,
MediaInformationSessionCompleteCallback completeCallback,
java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe execution to extract the media information for the
specified file.
|
static MediaInformationSession |
getMediaInformationAsync(java.lang.String path,
MediaInformationSessionCompleteCallback completeCallback,
LogCallback logCallback,
java.util.concurrent.ExecutorService executorService,
int waitTimeout)
Starts an asynchronous FFprobe execution to extract the media information for the
specified file.
|
static MediaInformationSession |
getMediaInformationAsync(java.lang.String path,
MediaInformationSessionCompleteCallback completeCallback,
LogCallback logCallback,
int waitTimeout)
Starts an asynchronous FFprobe execution to extract the media information for the
specified file.
|
static MediaInformationSession |
getMediaInformationFromCommand(java.lang.String command)
Extracts media information using the command provided.
|
static MediaInformationSession |
getMediaInformationFromCommandAsync(java.lang.String command,
MediaInformationSessionCompleteCallback completeCallback,
LogCallback logCallback,
int waitTimeout)
Starts an asynchronous FFprobe execution to extract media information using a command.
|
static java.util.List<FFprobeSession> |
listFFprobeSessions()
Lists all FFprobe sessions in the session history.
|
static java.util.List<MediaInformationSession> |
listMediaInformationSessions()
Lists all MediaInformation sessions in the session history.
|
public static FFprobeSession executeWithArguments(java.lang.String[] arguments)
Synchronously executes FFprobe with arguments provided.
arguments - FFprobe command options/arguments as string arraypublic static FFprobeSession executeWithArgumentsAsync(java.lang.String[] arguments, FFprobeSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution with arguments provided.
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.
arguments - FFprobe command options/arguments as string arraycompleteCallback - callback that will be called when the execution has completedpublic static FFprobeSession executeWithArgumentsAsync(java.lang.String[] arguments, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback)
Starts an asynchronous FFprobe execution with arguments provided.
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.
arguments - FFprobe command options/arguments as string arraycompleteCallback - callback that will be notified when execution has completedlogCallback - callback that will receive logspublic static FFprobeSession executeWithArgumentsAsync(java.lang.String[] arguments, FFprobeSessionCompleteCallback completeCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe execution with arguments provided.
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.
arguments - FFprobe 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 FFprobeSession executeWithArgumentsAsync(java.lang.String[] arguments, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe execution with arguments provided.
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.
arguments - FFprobe command options/arguments as string arraycompleteCallback - callback that will be notified when execution has 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, FFprobeSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe 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 FFprobeSessionCompleteCallback if you want to be notified about the
result.
command - FFprobe commandcompleteCallback - callback that will be called when the execution has completedpublic static FFprobeSession executeAsync(java.lang.String command, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback)
Starts an asynchronous FFprobe 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 FFprobeSessionCompleteCallback if you want to be notified about the
result.
command - FFprobe commandcompleteCallback - callback that will be notified when execution has completedlogCallback - callback that will receive logspublic static FFprobeSession executeAsync(java.lang.String command, FFprobeSessionCompleteCallback completeCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe 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 FFprobeSessionCompleteCallback if you want to be notified about the
result.
command - FFprobe commandcompleteCallback - callback that will be called when the execution has completedexecutorService - executor service that will be used to run this asynchronous operationpublic static FFprobeSession executeAsync(java.lang.String command, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe 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 FFprobeSessionCompleteCallback if you want to be notified about the
result.
command - FFprobe commandcompleteCallback - callback that will be called when the execution has 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, MediaInformationSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution to extract the media information for the specified file.
Note that this method returns immediately and does not wait the execution to complete.
You must use a MediaInformationSessionCompleteCallback if you want to be notified
about the result.
path - path or uri of a media filecompleteCallback - callback that will be called when the execution has completedpublic static MediaInformationSession getMediaInformationAsync(java.lang.String path, MediaInformationSessionCompleteCallback completeCallback, LogCallback logCallback, int waitTimeout)
Starts an asynchronous FFprobe execution to extract the media information for the specified file.
Note that this method returns immediately and does not wait the execution to complete.
You must use a MediaInformationSessionCompleteCallback if you want to be notified
about the result.
path - path or uri of a media filecompleteCallback - callback that will be notified when execution has completedlogCallback - callback that will receive logswaitTimeout - max time to wait until media information is transmittedpublic static MediaInformationSession getMediaInformationAsync(java.lang.String path, MediaInformationSessionCompleteCallback completeCallback, java.util.concurrent.ExecutorService executorService)
Starts an asynchronous FFprobe execution to extract the media information for the specified file.
Note that this method returns immediately and does not wait the execution to complete.
You must use a MediaInformationSessionCompleteCallback if you want to be notified
about the result.
path - path or uri of a media filecompleteCallback - callback that will be called when the execution has completedexecutorService - executor service that will be used to run this asynchronous operationpublic static MediaInformationSession getMediaInformationAsync(java.lang.String path, MediaInformationSessionCompleteCallback completeCallback, LogCallback logCallback, java.util.concurrent.ExecutorService executorService, int waitTimeout)
Starts an asynchronous FFprobe execution to extract the media information for the specified file.
Note that this method returns immediately and does not wait the execution to complete.
You must use a MediaInformationSessionCompleteCallback if you want to be notified
about the result.
path - path or uri of a media filecompleteCallback - callback that will be notified when execution has 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.
command - FFprobe command that prints media information for a file in JSON formatpublic static MediaInformationSession getMediaInformationFromCommandAsync(java.lang.String command, MediaInformationSessionCompleteCallback completeCallback, LogCallback logCallback, int waitTimeout)
Starts an asynchronous FFprobe execution to extract media information using a command. The command passed to this method must generate the output in JSON format in order to successfully extract media information from it.
Note that this method returns immediately and does not wait the execution to complete.
You must use a MediaInformationSessionCompleteCallback if you want to be notified
about the result.
command - FFprobe command that prints media information for a file in JSON
formatcompleteCallback - callback that will be notified when execution has completedlogCallback - callback that will receive logswaitTimeout - max time to wait until media information is transmittedpublic static java.util.List<FFprobeSession> listFFprobeSessions()
Lists all FFprobe sessions in the session history.
public static java.util.List<MediaInformationSession> listMediaInformationSessions()
Lists all MediaInformation sessions in the session history.