public class FFprobe
extends java.lang.Object
Main class for FFprobe operations. Provides execute(String...)
method to execute
FFprobe commands.
int rc = FFprobe.execute("-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4"); Log.i(Config.TAG, String.format("Command execution %s.", (rc == 0?"completed successfully":"failed with rc=" + rc));
Modifier and Type | Method and Description |
---|---|
static int |
execute(java.lang.String command)
Synchronously executes FFprobe command provided.
|
static int |
execute(java.lang.String[] arguments)
Synchronously executes FFprobe with arguments provided.
|
static MediaInformation |
getMediaInformation(java.lang.String path)
Returns media information for the given file.
|
static MediaInformation |
getMediaInformation(java.lang.String path,
java.lang.Long timeout)
Deprecated.
this method is deprecated since v4.3.1. You can still use this method but
timeout parameter is not effective anymore. |
static MediaInformation |
getMediaInformationFromCommand(java.lang.String command)
Returns media information for the given command.
|
public static int execute(java.lang.String[] arguments)
Synchronously executes FFprobe with arguments provided.
arguments
- FFprobe command options/arguments as string arraypublic static int execute(java.lang.String command)
Synchronously executes FFprobe command provided. Space character is used to split command into arguments. You can use single and double quote characters to specify arguments inside your command.
command
- FFprobe commandpublic static MediaInformation getMediaInformation(java.lang.String path)
Returns media information for the given file.
This method does not support executing multiple concurrent operations. If you execute multiple operations (execute or getMediaInformation) at the same time, the response of this method is not predictable.
path
- path or uri of media filepublic static MediaInformation getMediaInformationFromCommand(java.lang.String command)
Returns media information for the given command.
This method does not support executing multiple concurrent operations. If you execute multiple operations (execute or getMediaInformation) at the same time, the response of this method is not predictable.
command
- command to executepublic static MediaInformation getMediaInformation(java.lang.String path, java.lang.Long timeout)
timeout
parameter is not effective anymore.Returns media information for given file.
This method does not support executing multiple concurrent operations. If you execute multiple operations (execute or getMediaInformation) at the same time, the response of this method is not predictable.
path
- path or uri of media filetimeout
- complete timeout