-
public class FFprobeKit
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 method.
MediaInformationSession session = FFprobeKit.getMediaInformation("file1.mp4");
-
-
Method Summary
Modifier and Type Method Description static FFprobeSession
executeWithArguments(Array<String> arguments)
Synchronously executes FFprobe with arguments provided. static FFprobeSession
executeWithArgumentsAsync(Array<String> arguments, FFprobeSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution with arguments provided. static FFprobeSession
executeWithArgumentsAsync(Array<String> arguments, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback)
Starts an asynchronous FFprobe execution with arguments provided. static FFprobeSession
executeWithArgumentsAsync(Array<String> arguments, FFprobeSessionCompleteCallback completeCallback, ExecutorService executorService)
Starts an asynchronous FFprobe execution with arguments provided. static FFprobeSession
executeWithArgumentsAsync(Array<String> arguments, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback, ExecutorService executorService)
Starts an asynchronous FFprobe execution with arguments provided. static FFprobeSession
execute(String command)
Synchronously executes FFprobe command provided. static FFprobeSession
executeAsync(String command, FFprobeSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution for the given command. static FFprobeSession
executeAsync(String command, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback)
Starts an asynchronous FFprobe execution for the given command. static FFprobeSession
executeAsync(String command, FFprobeSessionCompleteCallback completeCallback, ExecutorService executorService)
Starts an asynchronous FFprobe execution for the given command. static FFprobeSession
executeAsync(String command, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback, ExecutorService executorService)
Starts an asynchronous FFprobe execution for the given command. static MediaInformationSession
getMediaInformation(String path)
Extracts media information for the file specified with path. static MediaInformationSession
getMediaInformation(String path, int waitTimeout)
Extracts media information for the file specified with path. static MediaInformationSession
getMediaInformationAsync(String path, MediaInformationSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution to extract the media information for thespecified file. static MediaInformationSession
getMediaInformationAsync(String path, MediaInformationSessionCompleteCallback completeCallback, LogCallback logCallback, int waitTimeout)
Starts an asynchronous FFprobe execution to extract the media information for thespecified file. static MediaInformationSession
getMediaInformationAsync(String path, MediaInformationSessionCompleteCallback completeCallback, ExecutorService executorService)
Starts an asynchronous FFprobe execution to extract the media information for thespecified file. static MediaInformationSession
getMediaInformationAsync(String path, MediaInformationSessionCompleteCallback completeCallback, LogCallback logCallback, ExecutorService executorService, int waitTimeout)
Starts an asynchronous FFprobe execution to extract the media information for thespecified file. static MediaInformationSession
getMediaInformationFromCommand(String command)
Extracts media information using the command provided. static MediaInformationSession
getMediaInformationFromCommandAsync(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 tosuccessfully extract media information from it. static List<FFprobeSession>
listFFprobeSessions()
Lists all FFprobe sessions in the session history. static List<MediaInformationSession>
listMediaInformationSessions()
Lists all MediaInformation sessions in the session history. -
-
Method Detail
-
executeWithArguments
static FFprobeSession executeWithArguments(Array<String> arguments)
Synchronously executes FFprobe with arguments provided.
- Parameters:
arguments
- FFprobe command options/arguments as string array
-
executeWithArgumentsAsync
static FFprobeSession executeWithArgumentsAsync(Array<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 theresult.
- Parameters:
arguments
- FFprobe command options/arguments as string arraycompleteCallback
- callback that will be called when the execution has completed
-
executeWithArgumentsAsync
static FFprobeSession executeWithArgumentsAsync(Array<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 theresult.
- Parameters:
arguments
- FFprobe command options/arguments as string arraycompleteCallback
- callback that will be notified when execution has completedlogCallback
- callback that will receive logs
-
executeWithArgumentsAsync
static FFprobeSession executeWithArgumentsAsync(Array<String> arguments, FFprobeSessionCompleteCallback completeCallback, 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 theresult.
- Parameters:
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 operation
-
executeWithArgumentsAsync
static FFprobeSession executeWithArgumentsAsync(Array<String> arguments, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback, 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 theresult.
- Parameters:
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 operation
-
execute
static FFprobeSession execute(String command)
Synchronously executes FFprobe command provided. Space character is used to split commandinto arguments. You can use single or double quote characters to specify arguments insideyour command.
- Parameters:
command
- FFprobe command
-
executeAsync
static FFprobeSession executeAsync(String command, FFprobeSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution for the given command. Space character is usedto split the command into arguments. You can use single or double quote characters tospecify 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 theresult.
- Parameters:
command
- FFprobe commandcompleteCallback
- callback that will be called when the execution has completed
-
executeAsync
static FFprobeSession executeAsync(String command, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback)
Starts an asynchronous FFprobe execution for the given command. Space character is usedto split the command into arguments. You can use single or double quote characters tospecify 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 theresult.
- Parameters:
command
- FFprobe commandcompleteCallback
- callback that will be notified when execution has completedlogCallback
- callback that will receive logs
-
executeAsync
static FFprobeSession executeAsync(String command, FFprobeSessionCompleteCallback completeCallback, ExecutorService executorService)
Starts an asynchronous FFprobe execution for the given command. Space character is usedto split the command into arguments. You can use single or double quote characters tospecify 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 theresult.
- Parameters:
command
- FFprobe commandcompleteCallback
- callback that will be called when the execution has completedexecutorService
- executor service that will be used to run this asynchronous operation
-
executeAsync
static FFprobeSession executeAsync(String command, FFprobeSessionCompleteCallback completeCallback, LogCallback logCallback, ExecutorService executorService)
Starts an asynchronous FFprobe execution for the given command. Space character is usedto split the command into arguments. You can use single or double quote characters tospecify 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 theresult.
- Parameters:
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 operation
-
getMediaInformation
static MediaInformationSession getMediaInformation(String path)
Extracts media information for the file specified with path.
- Parameters:
path
- path or uri of a media file
-
getMediaInformation
static MediaInformationSession getMediaInformation(String path, int waitTimeout)
Extracts media information for the file specified with path.
- Parameters:
path
- path or uri of a media filewaitTimeout
- max time to wait until media information is transmitted
-
getMediaInformationAsync
static MediaInformationSession getMediaInformationAsync(String path, MediaInformationSessionCompleteCallback completeCallback)
Starts an asynchronous FFprobe execution to extract the media information for thespecified 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 notifiedabout the result.
- Parameters:
path
- path or uri of a media filecompleteCallback
- callback that will be called when the execution has completed
-
getMediaInformationAsync
static MediaInformationSession getMediaInformationAsync(String path, MediaInformationSessionCompleteCallback completeCallback, LogCallback logCallback, int waitTimeout)
Starts an asynchronous FFprobe execution to extract the media information for thespecified 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 notifiedabout the result.
- Parameters:
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 transmitted
-
getMediaInformationAsync
static MediaInformationSession getMediaInformationAsync(String path, MediaInformationSessionCompleteCallback completeCallback, ExecutorService executorService)
Starts an asynchronous FFprobe execution to extract the media information for thespecified 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 notifiedabout the result.
- Parameters:
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 operation
-
getMediaInformationAsync
static MediaInformationSession getMediaInformationAsync(String path, MediaInformationSessionCompleteCallback completeCallback, LogCallback logCallback, ExecutorService executorService, int waitTimeout)
Starts an asynchronous FFprobe execution to extract the media information for thespecified 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 notifiedabout the result.
- Parameters:
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 transmitted
-
getMediaInformationFromCommand
static MediaInformationSession getMediaInformationFromCommand(String command)
Extracts media information using the command provided.
- Parameters:
command
- FFprobe command that prints media information for a file in JSON format
-
getMediaInformationFromCommandAsync
static MediaInformationSession getMediaInformationFromCommandAsync(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 tosuccessfully 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 notifiedabout the result.
- Parameters:
command
- FFprobe command that prints media information for a file in JSONformatcompleteCallback
- callback that will be notified when execution has completedlogCallback
- callback that will receive logswaitTimeout
- max time to wait until media information is transmitted
-
listFFprobeSessions
static List<FFprobeSession> listFFprobeSessions()
Lists all FFprobe sessions in the session history.
-
listMediaInformationSessions
static List<MediaInformationSession> listMediaInformationSessions()
Lists all MediaInformation sessions in the session history.
-
-
-
-