@ -23,16 +23,16 @@ import java.util.List;
import java.util.concurrent.ExecutorService ;
/ * *
* < p > Main class to run < code > FFprobe < / code > commands . Supports executing commands both synchronously and
* asynchronously .
* < p > Main class to run < code > FFprobe < / code > commands . Supports executing commands both
* synchronously and asynchronously .
* < pre >
* 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" , execu teCallback ) ;
* FFprobeSession asyncSession = FFprobeKit . executeAsync ( "-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4" , compl eteCallback) ;
* < / pre >
* < p > Provides overloaded < code > execute < / code > methods to define session specific callbacks .
* < pre >
* FFprobeSession session = FFprobeKit . executeAsync ( "-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4" , execu teCallback , logCallback ) ;
* FFprobeSession session = FFprobeKit . executeAsync ( "-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4" , compl eteCallback, logCallback ) ;
* < / pre >
* < p > It can extract media information for a file or a url , using { @link # getMediaInformation ( String ) } method .
* < pre >
@ -52,13 +52,23 @@ public class FFprobeKit {
private FFprobeKit ( ) {
}
/ * *
* < p > Builds the default command used to get media information for a file .
*
* @param path file path to use in the command
* @return default command arguments to get media information
* /
private static String [ ] defaultGetMediaInformationCommandArguments ( final String path ) {
return new String [ ] { "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-show_chapters" , "-i" , path } ;
}
/ * *
* < p > Synchronously executes FFprobe with arguments provided .
*
* @param arguments FFprobe command options / arguments as string array
* @return FFprobe session created for this execution
* /
public static FFprobeSession execute ( final String [ ] arguments ) {
public static FFprobeSession executeWithArguments ( final String [ ] arguments ) {
final FFprobeSession session = new FFprobeSession ( arguments ) ;
FFmpegKitConfig . ffprobeExecute ( session ) ;
@ -69,16 +79,17 @@ public class FFprobeKit {
/ * *
* < p > Starts an asynchronous FFprobe execution with arguments provided .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use an { @link FFprobeSessionCompleteCallback } if you want to be notified about the
* result .
*
* @param arguments FFprobe command options / arguments as string array
* @param execu teCallback callback that will be called when the execution i s completed
* @param arguments FFprobe command options / arguments as string array
* @param compl eteCallback callback that will be called when the execution ha s completed
* @return FFprobe session created for this execution
* /
public static FFprobeSession executeAsync ( final String [ ] arguments ,
final ExecuteCallback execu teCallback) {
final FFprobeSession session = new FFprobeSession ( arguments , execu teCallback ) ;
public static FFprobeSession executeWithArguments Async ( final String [ ] arguments ,
final FFprobeSessionCompleteCallback comple teCallback ) {
final FFprobeSession session = new FFprobeSession ( arguments , compl eteCallback) ;
FFmpegKitConfig . asyncFFprobeExecute ( session ) ;
@ -88,18 +99,19 @@ public class FFprobeKit {
/ * *
* < p > Starts an asynchronous FFprobe execution with arguments provided .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use an { @link FFprobeSessionCompleteCallback } if you want to be notified about the
* result .
*
* @param arguments FFprobe command options / arguments as string array
* @param execu teCallback callback that will be notified when execution i s completed
* @param logCallback callback that will receive logs
* @param arguments FFprobe command options / arguments as string array
* @param compl eteCallback callback that will be notified when execution ha s completed
* @param logCallback callback that will receive logs
* @return FFprobe session created for this execution
* /
public static FFprobeSession executeAsync ( final String [ ] arguments ,
final ExecuteCallback execu teCallback,
final LogCallback logCallback ) {
final FFprobeSession session = new FFprobeSession ( arguments , execu teCallback , logCallback ) ;
public static FFprobeSession executeWithArguments Async ( final String [ ] arguments ,
final FFprobeSessionCompleteCallback comple teCallback ,
final LogCallback logCallback ) {
final FFprobeSession session = new FFprobeSession ( arguments , compl eteCallback, logCallback ) ;
FFmpegKitConfig . asyncFFprobeExecute ( session ) ;
@ -109,18 +121,19 @@ public class FFprobeKit {
/ * *
* < p > Starts an asynchronous FFprobe execution with arguments provided .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use an { @link FFprobeSessionCompleteCallback } if you want to be notified about the
* result .
*
* @param arguments FFprobe command options / arguments as string array
* @param execu teCallback callback that will be called when the execution i s completed
* @param executorService executor service that will be used to run this asynchronous operation
* @param arguments FFprobe command options / arguments as string array
* @param compl eteCallback callback that will be called when the execution ha s completed
* @param executorService executor service that will be used to run this asynchronous operation
* @return FFprobe session created for this execution
* /
public static FFprobeSession executeAsync ( final String [ ] arguments ,
final ExecuteCallback execu teCallback,
final ExecutorService executorService ) {
final FFprobeSession session = new FFprobeSession ( arguments , execu teCallback ) ;
public static FFprobeSession executeWithArguments Async ( final String [ ] arguments ,
final FFprobeSessionCompleteCallback comple teCallback ,
final ExecutorService executorService ) {
final FFprobeSession session = new FFprobeSession ( arguments , compl eteCallback) ;
FFmpegKitConfig . asyncFFprobeExecute ( session , executorService ) ;
@ -130,20 +143,21 @@ public class FFprobeKit {
/ * *
* < p > Starts an asynchronous FFprobe execution with arguments provided .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use an { @link FFprobeSessionCompleteCallback } if you want to be notified about the
* result .
*
* @param arguments FFprobe command options / arguments as string array
* @param execu teCallback callback that will be notified when execution i s completed
* @param logCallback callback that will receive logs
* @param executorService executor service that will be used to run this asynchronous operation
* @param arguments FFprobe command options / arguments as string array
* @param compl eteCallback callback that will be notified when execution ha s completed
* @param logCallback callback that will receive logs
* @param executorService executor service that will be used to run this asynchronous operation
* @return FFprobe session created for this execution
* /
public static FFprobeSession executeAsync ( final String [ ] arguments ,
final ExecuteCallback execu teCallback,
final LogCallback logCallback ,
final ExecutorService executorService ) {
final FFprobeSession session = new FFprobeSession ( arguments , execu teCallback , logCallback ) ;
public static FFprobeSession executeWithArguments Async ( final String [ ] arguments ,
final FFprobeSessionCompleteCallback comple teCallback ,
final LogCallback logCallback ,
final ExecutorService executorService ) {
final FFprobeSession session = new FFprobeSession ( arguments , compl eteCallback, logCallback ) ;
FFmpegKitConfig . asyncFFprobeExecute ( session , executorService ) ;
@ -159,59 +173,65 @@ public class FFprobeKit {
* @return FFprobe session created for this execution
* /
public static FFprobeSession execute ( final String command ) {
return execute ( FFmpegKitConfig . parseArguments ( command ) ) ;
return executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) ) ;
}
/ * *
* < p > 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 .
* < p > 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 .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use an { @link FFprobeSessionCompleteCallback } if you want to be notified about the
* result .
*
* @param command FFprobe command
* @param execu teCallback callback that will be called when the execution i s completed
* @param command FFprobe command
* @param compl eteCallback callback that will be called when the execution ha s completed
* @return FFprobe session created for this execution
* /
public static FFprobeSession executeAsync ( final String command ,
final ExecuteCallback execu teCallback) {
return executeAsync ( FFmpegKitConfig . parseArguments ( command ) , execu teCallback ) ;
final FFprobeSessionCompleteCallback comple teCallback) {
return executeWithArguments Async ( FFmpegKitConfig . parseArguments ( command ) , compl eteCallback) ;
}
/ * *
* < p > 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 .
* < p > 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 .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use an { @link FFprobeSessionCompleteCallback } if you want to be notified about the
* result .
*
* @param command FFprobe command
* @param execu teCallback callback that will be notified when execution i s completed
* @param logCallback callback that will receive logs
* @param command FFprobe command
* @param compl eteCallback callback that will be notified when execution ha s completed
* @param logCallback callback that will receive logs
* @return FFprobe session created for this execution
* /
public static FFprobeSession executeAsync ( final String command ,
final ExecuteCallback execu teCallback,
final FFprobeSessionCompleteCallback comple teCallback,
final LogCallback logCallback ) {
return executeAsync ( FFmpegKitConfig . parseArguments ( command ) , execu teCallback , logCallback ) ;
return executeWithArguments Async ( FFmpegKitConfig . parseArguments ( command ) , compl eteCallback, logCallback ) ;
}
/ * *
* < p > 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 .
* < p > 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 .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use an { @link FFprobeSessionCompleteCallback } if you want to be notified about the
* result .
*
* @param command FFprobe command
* @param execu teCallback callback that will be called when the execution i s completed
* @param executorService executor service that will be used to run this asynchronous operation
* @param command FFprobe command
* @param compl eteCallback callback that will be called when the execution ha s completed
* @param executorService executor service that will be used to run this asynchronous operation
* @return FFprobe session created for this execution
* /
public static FFprobeSession executeAsync ( final String command ,
final ExecuteCallback execu teCallback,
final FFprobeSessionCompleteCallback comple teCallback,
final ExecutorService executorService ) {
final FFprobeSession session = new FFprobeSession ( FFmpegKitConfig . parseArguments ( command ) , execu teCallback ) ;
final FFprobeSession session = new FFprobeSession ( FFmpegKitConfig . parseArguments ( command ) , compl eteCallback) ;
FFmpegKitConfig . asyncFFprobeExecute ( session , executorService ) ;
@ -219,23 +239,25 @@ public class FFprobeKit {
}
/ * *
* < p > 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 .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
*
* @param command FFprobe command
* @param executeCallback callback that will be called when the execution is completed
* @param logCallback callback that will receive logs
* @param executorService executor service that will be used to run this asynchronous operation
* < p > 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 .
*
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use an { @link FFprobeSessionCompleteCallback } if you want to be notified about the
* result .
*
* @param command FFprobe command
* @param completeCallback callback that will be called when the execution has completed
* @param logCallback callback that will receive logs
* @param executorService executor service that will be used to run this asynchronous operation
* @return FFprobe session created for this execution
* /
public static FFprobeSession executeAsync ( final String command ,
final ExecuteCallback execu teCallback,
final FFprobeSessionCompleteCallback comple teCallback,
final LogCallback logCallback ,
final ExecutorService executorService ) {
final FFprobeSession session = new FFprobeSession ( FFmpegKitConfig . parseArguments ( command ) , execu teCallback , logCallback ) ;
final FFprobeSession session = new FFprobeSession ( FFmpegKitConfig . parseArguments ( command ) , compl eteCallback, logCallback ) ;
FFmpegKitConfig . asyncFFprobeExecute ( session , executorService ) ;
@ -249,7 +271,7 @@ public class FFprobeKit {
* @return media information session created for this execution
* /
public static MediaInformationSession getMediaInformation ( final String path ) {
final MediaInformationSession session = new MediaInformationSession ( new String [ ] { "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-i" , path } ) ;
final MediaInformationSession session = new MediaInformationSession ( defaultGetMediaInformationCommandArguments ( path ) ) ;
FFmpegKitConfig . getMediaInformationExecute ( session , AbstractSession . DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT ) ;
@ -265,7 +287,7 @@ public class FFprobeKit {
* /
public static MediaInformationSession getMediaInformation ( final String path ,
final int waitTimeout ) {
final MediaInformationSession session = new MediaInformationSession ( new String [ ] { "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-i" , path } ) ;
final MediaInformationSession session = new MediaInformationSession ( defaultGetMediaInformationCommandArguments ( path ) ) ;
FFmpegKitConfig . getMediaInformationExecute ( session , waitTimeout ) ;
@ -273,18 +295,20 @@ public class FFprobeKit {
}
/ * *
* < p > Starts an asynchronous FFprobe execution to extract the media information for the specified file .
* < p > Starts an asynchronous FFprobe execution to extract the media information for the
* specified file .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use a { @link MediaInformationSessionCompleteCallback } if you want to be notified
* about the result .
*
* @param path path or uri of a media file
* @param execu teCallback callback that will be called when the execution i s completed
* @param path path or uri of a media file
* @param compl eteCallback callback that will be called when the execution ha s completed
* @return media information session created for this execution
* /
public static MediaInformationSession getMediaInformationAsync ( final String path ,
final ExecuteCallback execu teCallback) {
final MediaInformationSession session = new MediaInformationSession ( new String [ ] { "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-i" , path } , execu teCallback) ;
final MediaInformationSessionCompleteCallback comple teCallback) {
final MediaInformationSession session = new MediaInformationSession ( defaultGetMediaInformationCommandArguments ( path ) , comple teCallback) ;
FFmpegKitConfig . asyncGetMediaInformationExecute ( session , AbstractSession . DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT ) ;
@ -292,22 +316,24 @@ public class FFprobeKit {
}
/ * *
* < p > Starts an asynchronous FFprobe execution to extract the media information for the specified file .
* < p > Starts an asynchronous FFprobe execution to extract the media information for the
* specified file .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use a { @link MediaInformationSessionCompleteCallback } if you want to be notified
* about the result .
*
* @param path path or uri of a media file
* @param execu teCallback callback that will be notified when execution i s completed
* @param logCallback callback that will receive logs
* @param waitTimeout max time to wait until media information is transmitted
* @param path path or uri of a media file
* @param compl eteCallback callback that will be notified when execution ha s completed
* @param logCallback callback that will receive logs
* @param waitTimeout max time to wait until media information is transmitted
* @return media information session created for this execution
* /
public static MediaInformationSession getMediaInformationAsync ( final String path ,
final ExecuteCallback execu teCallback,
final MediaInformationSessionCompleteCallback comple teCallback,
final LogCallback logCallback ,
final int waitTimeout ) {
final MediaInformationSession session = new MediaInformationSession ( new String [ ] { "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-i" , path } , execu teCallback, logCallback ) ;
final MediaInformationSession session = new MediaInformationSession ( defaultGetMediaInformationCommandArguments ( path ) , comple teCallback, logCallback ) ;
FFmpegKitConfig . asyncGetMediaInformationExecute ( session , waitTimeout ) ;
@ -315,20 +341,22 @@ public class FFprobeKit {
}
/ * *
* < p > Starts an asynchronous FFprobe execution to extract the media information for the specified file .
* < p > Starts an asynchronous FFprobe execution to extract the media information for the
* specified file .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use a { @link MediaInformationSessionCompleteCallback } if you want to be notified
* about the result .
*
* @param path path or uri of a media file
* @param execu teCallback callback that will be called when the execution i s completed
* @param executorService executor service that will be used to run this asynchronous operation
* @param path path or uri of a media file
* @param compl eteCallback callback that will be called when the execution ha s completed
* @param executorService executor service that will be used to run this asynchronous operation
* @return media information session created for this execution
* /
public static MediaInformationSession getMediaInformationAsync ( final String path ,
final ExecuteCallback execu teCallback,
final MediaInformationSessionCompleteCallback comple teCallback,
final ExecutorService executorService ) {
final MediaInformationSession session = new MediaInformationSession ( new String [ ] { "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-i" , path } , execu teCallback) ;
final MediaInformationSession session = new MediaInformationSession ( defaultGetMediaInformationCommandArguments ( path ) , comple teCallback) ;
FFmpegKitConfig . asyncGetMediaInformationExecute ( session , executorService , AbstractSession . DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT ) ;
@ -336,24 +364,26 @@ public class FFprobeKit {
}
/ * *
* < p > Starts an asynchronous FFprobe execution to extract the media information for the specified file .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
*
* @param path path or uri of a media file
* @param executeCallback callback that will be notified when execution is completed
* @param logCallback callback that will receive logs
* @param executorService executor service that will be used to run this asynchronous operation
* @param waitTimeout max time to wait until media information is transmitted
* < p > Starts an asynchronous FFprobe execution to extract the media information for the
* specified file .
*
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use a { @link MediaInformationSessionCompleteCallback } if you want to be notified
* about the result .
*
* @param path path or uri of a media file
* @param completeCallback callback that will be notified when execution has completed
* @param logCallback callback that will receive logs
* @param executorService executor service that will be used to run this asynchronous operation
* @param waitTimeout max time to wait until media information is transmitted
* @return media information session created for this execution
* /
public static MediaInformationSession getMediaInformationAsync ( final String path ,
final ExecuteCallback execu teCallback,
final MediaInformationSessionCompleteCallback comple teCallback,
final LogCallback logCallback ,
final ExecutorService executorService ,
final int waitTimeout ) {
final MediaInformationSession session = new MediaInformationSession ( new String [ ] { "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-i" , path } , execu teCallback, logCallback ) ;
final MediaInformationSession session = new MediaInformationSession ( defaultGetMediaInformationCommandArguments ( path ) , comple teCallback, logCallback ) ;
FFmpegKitConfig . asyncGetMediaInformationExecute ( session , executorService , waitTimeout ) ;
@ -361,7 +391,7 @@ public class FFprobeKit {
}
/ * *
* < p > Extracts media information using the command provided asynchronously .
* < p > Extracts media information using the command provided .
*
* @param command FFprobe command that prints media information for a file in JSON format
* @return media information session created for this execution
@ -369,52 +399,57 @@ public class FFprobeKit {
public static MediaInformationSession getMediaInformationFromCommand ( final String command ) {
final MediaInformationSession session = new MediaInformationSession ( FFmpegKitConfig . parseArguments ( command ) ) ;
FFmpegKitConfig . asyncG etMediaInformationExecute( session , AbstractSession . DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT ) ;
FFmpegKitConfig . g etMediaInformationExecute( session , AbstractSession . DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT ) ;
return session ;
}
/ * *
* < p > 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 .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
*
* @param command FFprobe command that prints media information for a file in JSON format
* @param executeCallback callback that will be notified when execution is completed
* @param logCallback callback that will receive logs
* @param waitTimeout max time to wait until media information is transmitted
* < p > 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 .
*
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use a { @link MediaInformationSessionCompleteCallback } if you want to be notified
* about the result .
*
* @param command FFprobe command that prints media information for a file in JSON
* format
* @param completeCallback callback that will be notified when execution has completed
* @param logCallback callback that will receive logs
* @param waitTimeout max time to wait until media information is transmitted
* @return media information session created for this execution
* /
public static MediaInformationSession getMediaInformationFromCommandAsync ( final String command ,
final ExecuteCallback execu teCallback,
final MediaInformationSessionCompleteCallback comple teCallback,
final LogCallback logCallback ,
final int waitTimeout ) {
return getMediaInformationFromCommandArgumentsAsync ( FFmpegKitConfig . parseArguments ( command ) , execu teCallback , logCallback , waitTimeout ) ;
return getMediaInformationFromCommandArgumentsAsync ( FFmpegKitConfig . parseArguments ( command ) , compl eteCallback, logCallback , waitTimeout ) ;
}
/ * *
* < p > Starts an asynchronous FFprobe execution to extract media information using command arguments . The command
* passed to this method must generate the output in JSON format in order to successfully extract media information
* from it .
*
* < p > Note that this method returns immediately and does not wait the execution to complete . You must use an
* { @jlink ExecuteCallback } if you want to be notified about the result .
*
* @param arguments FFprobe command arguments that print media information for a file in JSON format
* @param executeCallback callback that will be notified when execution is completed
* @param logCallback callback that will receive logs
* @param waitTimeout max time to wait until media information is transmitted
* < p > Starts an asynchronous FFprobe execution to extract media information using command
* arguments . The command passed to this method must generate the output in JSON format in
* order to successfully extract media information from it .
*
* < p > Note that this method returns immediately and does not wait the execution to complete .
* You must use a { @link MediaInformationSessionCompleteCallback } if you want to be notified
* about the result .
*
* @param arguments FFprobe command arguments that print media information for a file in
* JSON format
* @param completeCallback callback that will be notified when execution has completed
* @param logCallback callback that will receive logs
* @param waitTimeout max time to wait until media information is transmitted
* @return media information session created for this execution
* /
private static MediaInformationSession getMediaInformationFromCommandArgumentsAsync ( final String [ ] arguments ,
final ExecuteCallback execu teCallback,
final MediaInformationSessionCompleteCallback comple teCallback,
final LogCallback logCallback ,
final int waitTimeout ) {
final MediaInformationSession session = new MediaInformationSession ( arguments , execu teCallback , logCallback ) ;
final MediaInformationSession session = new MediaInformationSession ( arguments , compl eteCallback, logCallback ) ;
FFmpegKitConfig . g etMediaInformationExecute( session , waitTimeout ) ;
FFmpegKitConfig . asyncG etMediaInformationExecute( session , waitTimeout ) ;
return session ;
}
@ -424,8 +459,17 @@ public class FFprobeKit {
*
* @return all FFprobe sessions in the session history
* /
public static List < FFprobeSession > listSessions ( ) {
public static List < FFprobeSession > listFFprobe Sessions ( ) {
return FFmpegKitConfig . getFFprobeSessions ( ) ;
}
/ * *
* < p > Lists all MediaInformation sessions in the session history .
*
* @return all MediaInformation sessions in the session history
* /
public static List < MediaInformationSession > listMediaInformationSessions ( ) {
return FFmpegKitConfig . getMediaInformationSessions ( ) ;
}
}