@@ -709,26 +709,20 @@ export class FFmpegKit {
709
709
* into arguments. You can use single or double quote characters to specify arguments inside your command.
710
710
*
711
711
* @param command FFmpeg command
712
- * @param completeCallback callback that will be called when the execution has completed
713
- * @param logCallback callback that will receive logs
714
- * @param statisticsCallback callback that will receive statistics
715
712
* @return FFmpeg session created for this execution
716
713
*/
717
- static async execute ( command , completeCallback , logCallback , statisticsCallback ) {
718
- return FFmpegKit . executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) , completeCallback , logCallback , statisticsCallback ) ;
714
+ static async execute ( command ) {
715
+ return FFmpegKit . executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) ) ;
719
716
}
720
717
721
718
/**
722
719
* <p>Synchronously executes FFmpeg with arguments provided.
723
720
*
724
721
* @param commandArguments FFmpeg command options/arguments as string array
725
- * @param completeCallback callback that will be called when the execution has completed
726
- * @param logCallback callback that will receive logs
727
- * @param statisticsCallback callback that will receive statistics
728
722
* @return FFmpeg session created for this execution
729
723
*/
730
- static async executeWithArguments ( commandArguments , completeCallback , logCallback , statisticsCallback ) {
731
- let session = await FFmpegSession . create ( commandArguments , completeCallback , logCallback , statisticsCallback ) ;
724
+ static async executeWithArguments ( commandArguments ) {
725
+ let session = await FFmpegSession . create ( commandArguments , undefined , undefined , undefined ) ;
732
726
733
727
await FFmpegKitConfig . ffmpegExecute ( session ) ;
734
728
@@ -1614,7 +1608,7 @@ class FFmpegKitFactory {
1614
1608
}
1615
1609
1616
1610
static getVersion ( ) {
1617
- return "4.5" ;
1611
+ return "4.5.1 " ;
1618
1612
}
1619
1613
1620
1614
static getLogRedirectionStrategy ( sessionId ) {
@@ -2055,24 +2049,20 @@ export class FFprobeKit {
2055
2049
* into arguments. You can use single or double quote characters to specify arguments inside your command.
2056
2050
*
2057
2051
* @param command FFprobe command
2058
- * @param completeCallback callback that will be called when the execution has completed
2059
- * @param logCallback callback that will receive logs
2060
2052
* @return FFprobe session created for this execution
2061
2053
*/
2062
- static async execute ( command , completeCallback , logCallback ) {
2063
- return FFprobeKit . executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) , completeCallback , logCallback ) ;
2054
+ static async execute ( command ) {
2055
+ return FFprobeKit . executeWithArguments ( FFmpegKitConfig . parseArguments ( command ) ) ;
2064
2056
}
2065
2057
2066
2058
/**
2067
2059
* <p>Synchronously executes FFprobe with arguments provided.
2068
2060
*
2069
2061
* @param commandArguments FFprobe command options/arguments as string array
2070
- * @param completeCallback callback that will be called when the execution has completed
2071
- * @param logCallback callback that will receive logs
2072
2062
* @return FFprobe session created for this execution
2073
2063
*/
2074
- static async executeWithArguments ( commandArguments , completeCallback , logCallback ) {
2075
- let session = await FFprobeSession . create ( commandArguments , completeCallback , logCallback ) ;
2064
+ static async executeWithArguments ( commandArguments ) {
2065
+ let session = await FFprobeSession . create ( commandArguments , undefined , undefined ) ;
2076
2066
2077
2067
await FFmpegKitConfig . ffprobeExecute ( session ) ;
2078
2068
@@ -2118,28 +2108,24 @@ export class FFprobeKit {
2118
2108
* <p>Extracts media information for the file specified with path.
2119
2109
*
2120
2110
* @param path path or uri of a media file
2121
- * @param completeCallback callback that will be notified when execution has completed
2122
- * @param logCallback callback that will receive logs
2123
2111
* @param waitTimeout max time to wait until media information is transmitted
2124
2112
* @return media information session created for this execution
2125
2113
*/
2126
- static async getMediaInformation ( path , completeCallback , logCallback , waitTimeout ) {
2114
+ static async getMediaInformation ( path , waitTimeout ) {
2127
2115
const commandArguments = [ "-v" , "error" , "-hide_banner" , "-print_format" , "json" , "-show_format" , "-show_streams" , "-show_chapters" , "-i" , path ] ;
2128
- return FFprobeKit . getMediaInformationFromCommandArguments ( commandArguments , completeCallback , logCallback , waitTimeout ) ;
2116
+ return FFprobeKit . getMediaInformationFromCommandArguments ( commandArguments , waitTimeout ) ;
2129
2117
}
2130
2118
2131
2119
/**
2132
2120
* <p>Extracts media information using the command provided. The command passed to
2133
2121
* this method must generate the output in JSON format in order to successfully extract media information from it.
2134
2122
*
2135
2123
* @param command FFprobe command that prints media information for a file in JSON format
2136
- * @param completeCallback callback that will be notified when execution has completed
2137
- * @param logCallback callback that will receive logs
2138
2124
* @param waitTimeout max time to wait until media information is transmitted
2139
2125
* @return media information session created for this execution
2140
2126
*/
2141
- static async getMediaInformationFromCommand ( command , completeCallback , logCallback , waitTimeout ) {
2142
- return FFprobeKit . getMediaInformationFromCommandArguments ( FFmpegKitConfig . parseArguments ( command ) , completeCallback , logCallback , waitTimeout ) ;
2127
+ static async getMediaInformationFromCommand ( command , waitTimeout ) {
2128
+ return FFprobeKit . getMediaInformationFromCommandArguments ( FFmpegKitConfig . parseArguments ( command ) , waitTimeout ) ;
2143
2129
}
2144
2130
2145
2131
/**
@@ -2148,16 +2134,19 @@ export class FFprobeKit {
2148
2134
* from it.
2149
2135
*
2150
2136
* @param commandArguments FFprobe command arguments that prints media information for a file in JSON format
2151
- * @param completeCallback callback that will be notified when execution has completed
2152
- * @param logCallback callback that will receive logs
2153
2137
* @param waitTimeout max time to wait until media information is transmitted
2154
2138
* @return media information session created for this execution
2155
2139
*/
2156
- static async getMediaInformationFromCommandArguments ( commandArguments , completeCallback , logCallback , waitTimeout ) {
2157
- let session = await MediaInformationSession . create ( commandArguments , completeCallback , logCallback ) ;
2140
+ static async getMediaInformationFromCommandArguments ( commandArguments , waitTimeout ) {
2141
+ let session = await MediaInformationSession . create ( commandArguments , undefined , undefined ) ;
2158
2142
2159
2143
await FFmpegKitConfig . getMediaInformationExecute ( session , waitTimeout ) ;
2160
2144
2145
+ const mediaInformation = await FFmpegKitReactNativeModule . getMediaInformation ( session . getSessionId ( ) ) ;
2146
+ if ( mediaInformation !== undefined && mediaInformation !== null ) {
2147
+ session . setMediaInformation ( new MediaInformation ( mediaInformation ) ) ;
2148
+ }
2149
+
2161
2150
return session ;
2162
2151
}
2163
2152
@@ -2214,6 +2203,11 @@ export class FFprobeKit {
2214
2203
2215
2204
await FFmpegKitConfig . asyncGetMediaInformationExecute ( session , waitTimeout ) ;
2216
2205
2206
+ const mediaInformation = await FFmpegKitReactNativeModule . getMediaInformation ( session . getSessionId ( ) ) ;
2207
+ if ( mediaInformation !== undefined && mediaInformation !== null ) {
2208
+ session . setMediaInformation ( new MediaInformation ( mediaInformation ) ) ;
2209
+ }
2210
+
2217
2211
return session ;
2218
2212
}
2219
2213
0 commit comments