|
|
@ -23,16 +23,16 @@ import java.util.List; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Main class to run <code>FFprobe</code> commands. Supports executing commands both synchronously and |
|
|
|
* <p>Main class to run <code>FFprobe</code> commands. Supports executing commands both |
|
|
|
* asynchronously. |
|
|
|
* synchronously and asynchronously. |
|
|
|
* <pre> |
|
|
|
* <pre> |
|
|
|
* FFprobeSession session = FFprobeKit.execute("-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4"); |
|
|
|
* 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); |
|
|
|
* FFprobeSession asyncSession = FFprobeKit.executeAsync("-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4", completeCallback); |
|
|
|
* </pre> |
|
|
|
* </pre> |
|
|
|
* <p>Provides overloaded <code>execute</code> methods to define session specific callbacks. |
|
|
|
* <p>Provides overloaded <code>execute</code> methods to define session specific callbacks. |
|
|
|
* <pre> |
|
|
|
* <pre> |
|
|
|
* FFprobeSession session = FFprobeKit.executeAsync("-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4", executeCallback, logCallback); |
|
|
|
* FFprobeSession session = FFprobeKit.executeAsync("-hide_banner -v error -show_entries format=size -of default=noprint_wrappers=1 file1.mp4", completeCallback, logCallback); |
|
|
|
* </pre> |
|
|
|
* </pre> |
|
|
|
* <p>It can extract media information for a file or a url, using {@link #getMediaInformation(String)} method. |
|
|
|
* <p>It can extract media information for a file or a url, using {@link #getMediaInformation(String)} method. |
|
|
|
* <pre> |
|
|
|
* <pre> |
|
|
@ -79,16 +79,17 @@ public class FFprobeKit { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution with arguments provided. |
|
|
|
* <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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* 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 arguments FFprobe command options/arguments as string array |
|
|
|
* @param executeCallback callback that will be called when the execution is completed |
|
|
|
* @param completeCallback callback that will be called when the execution has completed |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static FFprobeSession executeWithArgumentsAsync(final String[] arguments, |
|
|
|
public static FFprobeSession executeWithArgumentsAsync(final String[] arguments, |
|
|
|
final ExecuteCallback executeCallback) { |
|
|
|
final FFprobeSessionCompleteCallback completeCallback) { |
|
|
|
final FFprobeSession session = new FFprobeSession(arguments, executeCallback); |
|
|
|
final FFprobeSession session = new FFprobeSession(arguments, completeCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session); |
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session); |
|
|
|
|
|
|
|
|
|
|
@ -98,18 +99,19 @@ public class FFprobeKit { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution with arguments provided. |
|
|
|
* <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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* 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 arguments FFprobe command options/arguments as string array |
|
|
|
* @param executeCallback callback that will be notified when execution is completed |
|
|
|
* @param completeCallback callback that will be notified when execution has completed |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static FFprobeSession executeWithArgumentsAsync(final String[] arguments, |
|
|
|
public static FFprobeSession executeWithArgumentsAsync(final String[] arguments, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final FFprobeSessionCompleteCallback completeCallback, |
|
|
|
final LogCallback logCallback) { |
|
|
|
final LogCallback logCallback) { |
|
|
|
final FFprobeSession session = new FFprobeSession(arguments, executeCallback, logCallback); |
|
|
|
final FFprobeSession session = new FFprobeSession(arguments, completeCallback, logCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session); |
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session); |
|
|
|
|
|
|
|
|
|
|
@ -119,18 +121,19 @@ public class FFprobeKit { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution with arguments provided. |
|
|
|
* <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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* 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 arguments FFprobe command options/arguments as string array |
|
|
|
* @param executeCallback callback that will be called when the execution is completed |
|
|
|
* @param completeCallback callback that will be called when the execution has completed |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static FFprobeSession executeWithArgumentsAsync(final String[] arguments, |
|
|
|
public static FFprobeSession executeWithArgumentsAsync(final String[] arguments, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final FFprobeSessionCompleteCallback completeCallback, |
|
|
|
final ExecutorService executorService) { |
|
|
|
final ExecutorService executorService) { |
|
|
|
final FFprobeSession session = new FFprobeSession(arguments, executeCallback); |
|
|
|
final FFprobeSession session = new FFprobeSession(arguments, completeCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session, executorService); |
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session, executorService); |
|
|
|
|
|
|
|
|
|
|
@ -140,20 +143,21 @@ public class FFprobeKit { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution with arguments provided. |
|
|
|
* <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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* 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 arguments FFprobe command options/arguments as string array |
|
|
|
* @param executeCallback callback that will be notified when execution is completed |
|
|
|
* @param completeCallback callback that will be notified when execution has completed |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static FFprobeSession executeWithArgumentsAsync(final String[] arguments, |
|
|
|
public static FFprobeSession executeWithArgumentsAsync(final String[] arguments, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final FFprobeSessionCompleteCallback completeCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final ExecutorService executorService) { |
|
|
|
final ExecutorService executorService) { |
|
|
|
final FFprobeSession session = new FFprobeSession(arguments, executeCallback, logCallback); |
|
|
|
final FFprobeSession session = new FFprobeSession(arguments, completeCallback, logCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session, executorService); |
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session, executorService); |
|
|
|
|
|
|
|
|
|
|
@ -173,55 +177,61 @@ public class FFprobeKit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution for the given command. Space character is used to split the command |
|
|
|
* <p>Starts an asynchronous FFprobe execution for the given command. Space character is used |
|
|
|
* into arguments. You can use single or double quote characters to specify arguments inside your command. |
|
|
|
* 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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* You must use an {@link FFprobeSessionCompleteCallback} if you want to be notified about the |
|
|
|
|
|
|
|
* result. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param command FFprobe command |
|
|
|
* @param command FFprobe command |
|
|
|
* @param executeCallback callback that will be called when the execution is completed |
|
|
|
* @param completeCallback callback that will be called when the execution has completed |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static FFprobeSession executeAsync(final String command, |
|
|
|
public static FFprobeSession executeAsync(final String command, |
|
|
|
final ExecuteCallback executeCallback) { |
|
|
|
final FFprobeSessionCompleteCallback completeCallback) { |
|
|
|
return executeWithArgumentsAsync(FFmpegKitConfig.parseArguments(command), executeCallback); |
|
|
|
return executeWithArgumentsAsync(FFmpegKitConfig.parseArguments(command), completeCallback); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution for the given command. Space character is used to split the command |
|
|
|
* <p>Starts an asynchronous FFprobe execution for the given command. Space character is used |
|
|
|
* into arguments. You can use single or double quote characters to specify arguments inside your command. |
|
|
|
* 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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* You must use an {@link FFprobeSessionCompleteCallback} if you want to be notified about the |
|
|
|
|
|
|
|
* result. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param command FFprobe command |
|
|
|
* @param command FFprobe command |
|
|
|
* @param executeCallback callback that will be notified when execution is completed |
|
|
|
* @param completeCallback callback that will be notified when execution has completed |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static FFprobeSession executeAsync(final String command, |
|
|
|
public static FFprobeSession executeAsync(final String command, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final FFprobeSessionCompleteCallback completeCallback, |
|
|
|
final LogCallback logCallback) { |
|
|
|
final LogCallback logCallback) { |
|
|
|
return executeWithArgumentsAsync(FFmpegKitConfig.parseArguments(command), executeCallback, logCallback); |
|
|
|
return executeWithArgumentsAsync(FFmpegKitConfig.parseArguments(command), completeCallback, logCallback); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution for the given command. Space character is used to split the command |
|
|
|
* <p>Starts an asynchronous FFprobe execution for the given command. Space character is used |
|
|
|
* into arguments. You can use single or double quote characters to specify arguments inside your command. |
|
|
|
* 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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* You must use an {@link FFprobeSessionCompleteCallback} if you want to be notified about the |
|
|
|
|
|
|
|
* result. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param command FFprobe command |
|
|
|
* @param command FFprobe command |
|
|
|
* @param executeCallback callback that will be called when the execution is completed |
|
|
|
* @param completeCallback callback that will be called when the execution has completed |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static FFprobeSession executeAsync(final String command, |
|
|
|
public static FFprobeSession executeAsync(final String command, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final FFprobeSessionCompleteCallback completeCallback, |
|
|
|
final ExecutorService executorService) { |
|
|
|
final ExecutorService executorService) { |
|
|
|
final FFprobeSession session = new FFprobeSession(FFmpegKitConfig.parseArguments(command), executeCallback); |
|
|
|
final FFprobeSession session = new FFprobeSession(FFmpegKitConfig.parseArguments(command), completeCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session, executorService); |
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session, executorService); |
|
|
|
|
|
|
|
|
|
|
@ -229,23 +239,25 @@ public class FFprobeKit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution for the given command. Space character is used to split the command |
|
|
|
* <p>Starts an asynchronous FFprobe execution for the given command. Space character is used |
|
|
|
* into arguments. You can use single or double quote characters to specify arguments inside your command. |
|
|
|
* 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 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 |
|
|
|
* @param command FFprobe command |
|
|
|
* result. |
|
|
|
* @param executeCallback callback that will be called when the execution is completed |
|
|
|
* |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param command FFprobe command |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @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 |
|
|
|
* @return FFprobe session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static FFprobeSession executeAsync(final String command, |
|
|
|
public static FFprobeSession executeAsync(final String command, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final FFprobeSessionCompleteCallback completeCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final ExecutorService executorService) { |
|
|
|
final ExecutorService executorService) { |
|
|
|
final FFprobeSession session = new FFprobeSession(FFmpegKitConfig.parseArguments(command), executeCallback, logCallback); |
|
|
|
final FFprobeSession session = new FFprobeSession(FFmpegKitConfig.parseArguments(command), completeCallback, logCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session, executorService); |
|
|
|
FFmpegKitConfig.asyncFFprobeExecute(session, executorService); |
|
|
|
|
|
|
|
|
|
|
@ -283,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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* 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 path path or uri of a media file |
|
|
|
* @param executeCallback callback that will be called when the execution is completed |
|
|
|
* @param completeCallback callback that will be called when the execution has completed |
|
|
|
* @return media information session created for this execution |
|
|
|
* @return media information session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static MediaInformationSession getMediaInformationAsync(final String path, |
|
|
|
public static MediaInformationSession getMediaInformationAsync(final String path, |
|
|
|
final ExecuteCallback executeCallback) { |
|
|
|
final MediaInformationSessionCompleteCallback completeCallback) { |
|
|
|
final MediaInformationSession session = new MediaInformationSession(defaultGetMediaInformationCommandArguments(path), executeCallback); |
|
|
|
final MediaInformationSession session = new MediaInformationSession(defaultGetMediaInformationCommandArguments(path), completeCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, AbstractSession.DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT); |
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, AbstractSession.DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT); |
|
|
|
|
|
|
|
|
|
|
@ -302,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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* 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 path path or uri of a media file |
|
|
|
* @param executeCallback callback that will be notified when execution is completed |
|
|
|
* @param completeCallback callback that will be notified when execution has completed |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param waitTimeout max time to wait until media information is transmitted |
|
|
|
* @param waitTimeout max time to wait until media information is transmitted |
|
|
|
* @return media information session created for this execution |
|
|
|
* @return media information session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static MediaInformationSession getMediaInformationAsync(final String path, |
|
|
|
public static MediaInformationSession getMediaInformationAsync(final String path, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final MediaInformationSessionCompleteCallback completeCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final int waitTimeout) { |
|
|
|
final int waitTimeout) { |
|
|
|
final MediaInformationSession session = new MediaInformationSession(defaultGetMediaInformationCommandArguments(path), executeCallback, logCallback); |
|
|
|
final MediaInformationSession session = new MediaInformationSession(defaultGetMediaInformationCommandArguments(path), completeCallback, logCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, waitTimeout); |
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, waitTimeout); |
|
|
|
|
|
|
|
|
|
|
@ -325,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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* 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 path path or uri of a media file |
|
|
|
* @param executeCallback callback that will be called when the execution is completed |
|
|
|
* @param completeCallback callback that will be called when the execution has completed |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @return media information session created for this execution |
|
|
|
* @return media information session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static MediaInformationSession getMediaInformationAsync(final String path, |
|
|
|
public static MediaInformationSession getMediaInformationAsync(final String path, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final MediaInformationSessionCompleteCallback completeCallback, |
|
|
|
final ExecutorService executorService) { |
|
|
|
final ExecutorService executorService) { |
|
|
|
final MediaInformationSession session = new MediaInformationSession(defaultGetMediaInformationCommandArguments(path), executeCallback); |
|
|
|
final MediaInformationSession session = new MediaInformationSession(defaultGetMediaInformationCommandArguments(path), completeCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, executorService, AbstractSession.DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT); |
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, executorService, AbstractSession.DEFAULT_TIMEOUT_FOR_ASYNCHRONOUS_MESSAGES_IN_TRANSMIT); |
|
|
|
|
|
|
|
|
|
|
@ -346,24 +364,26 @@ 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 |
|
|
|
* |
|
|
|
* {@link 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 |
|
|
|
* @param path path or uri of a media file |
|
|
|
* about the result. |
|
|
|
* @param executeCallback callback that will be notified when execution is completed |
|
|
|
* |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param path path or uri of a media file |
|
|
|
* @param executorService executor service that will be used to run this asynchronous operation |
|
|
|
* @param completeCallback callback that will be notified when execution has completed |
|
|
|
* @param waitTimeout max time to wait until media information is transmitted |
|
|
|
* @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 |
|
|
|
* @return media information session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static MediaInformationSession getMediaInformationAsync(final String path, |
|
|
|
public static MediaInformationSession getMediaInformationAsync(final String path, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final MediaInformationSessionCompleteCallback completeCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final ExecutorService executorService, |
|
|
|
final ExecutorService executorService, |
|
|
|
final int waitTimeout) { |
|
|
|
final int waitTimeout) { |
|
|
|
final MediaInformationSession session = new MediaInformationSession(defaultGetMediaInformationCommandArguments(path), executeCallback, logCallback); |
|
|
|
final MediaInformationSession session = new MediaInformationSession(defaultGetMediaInformationCommandArguments(path), completeCallback, logCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, executorService, waitTimeout); |
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, executorService, waitTimeout); |
|
|
|
|
|
|
|
|
|
|
@ -385,44 +405,49 @@ public class FFprobeKit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution to extract media information using a command. The command passed to |
|
|
|
* <p>Starts an asynchronous FFprobe execution to extract media information using a command. |
|
|
|
* this method must generate the output in JSON format in order to successfully extract media information from it. |
|
|
|
* 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 |
|
|
|
* |
|
|
|
* {@link 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 |
|
|
|
* @param command FFprobe command that prints media information for a file in JSON format |
|
|
|
* about the result. |
|
|
|
* @param executeCallback callback that will be notified when execution is completed |
|
|
|
* |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* @param command FFprobe command that prints media information for a file in JSON |
|
|
|
* @param waitTimeout max time to wait until media information is transmitted |
|
|
|
* 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 |
|
|
|
* @return media information session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static MediaInformationSession getMediaInformationFromCommandAsync(final String command, |
|
|
|
public static MediaInformationSession getMediaInformationFromCommandAsync(final String command, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final MediaInformationSessionCompleteCallback completeCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final int waitTimeout) { |
|
|
|
final int waitTimeout) { |
|
|
|
return getMediaInformationFromCommandArgumentsAsync(FFmpegKitConfig.parseArguments(command), executeCallback, logCallback, waitTimeout); |
|
|
|
return getMediaInformationFromCommandArgumentsAsync(FFmpegKitConfig.parseArguments(command), completeCallback, logCallback, waitTimeout); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* <p>Starts an asynchronous FFprobe execution to extract media information using command arguments. The command |
|
|
|
* <p>Starts an asynchronous FFprobe execution to extract media information using command |
|
|
|
* passed to this method must generate the output in JSON format in order to successfully extract media information |
|
|
|
* arguments. The command passed to this method must generate the output in JSON format in |
|
|
|
* from it. |
|
|
|
* 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 |
|
|
|
* <p>Note that this method returns immediately and does not wait the execution to complete. |
|
|
|
* {@link ExecuteCallback} if you want to be notified about the result. |
|
|
|
* 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 executeCallback callback that will be notified when execution is completed |
|
|
|
* @param arguments FFprobe command arguments that print media information for a file in |
|
|
|
* @param logCallback callback that will receive logs |
|
|
|
* JSON format |
|
|
|
* @param waitTimeout max time to wait until media information is transmitted |
|
|
|
* @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 |
|
|
|
* @return media information session created for this execution |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static MediaInformationSession getMediaInformationFromCommandArgumentsAsync(final String[] arguments, |
|
|
|
private static MediaInformationSession getMediaInformationFromCommandArgumentsAsync(final String[] arguments, |
|
|
|
final ExecuteCallback executeCallback, |
|
|
|
final MediaInformationSessionCompleteCallback completeCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final LogCallback logCallback, |
|
|
|
final int waitTimeout) { |
|
|
|
final int waitTimeout) { |
|
|
|
final MediaInformationSession session = new MediaInformationSession(arguments, executeCallback, logCallback); |
|
|
|
final MediaInformationSession session = new MediaInformationSession(arguments, completeCallback, logCallback); |
|
|
|
|
|
|
|
|
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, waitTimeout); |
|
|
|
FFmpegKitConfig.asyncGetMediaInformationExecute(session, waitTimeout); |
|
|
|
|
|
|
|
|
|
|
@ -434,8 +459,17 @@ public class FFprobeKit { |
|
|
|
* |
|
|
|
* |
|
|
|
* @return all FFprobe sessions in the session history |
|
|
|
* @return all FFprobe sessions in the session history |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static List<FFprobeSession> listSessions() { |
|
|
|
public static List<FFprobeSession> listFFprobeSessions() { |
|
|
|
return FFmpegKitConfig.getFFprobeSessions(); |
|
|
|
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(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|