from static method
Extracts MediaInformation from the given FFprobe json output. Note that this method does not fail as fromWithError does and returns null on error.
Implementation
static Future<MediaInformation?> from(String ffprobeJsonOutput) async {
try {
await FFmpegKitConfig.init();
return _platform.mediaInformationJsonParserFrom(ffprobeJsonOutput).then((
properties,
) {
if (properties == null || properties.isEmpty) {
return null;
} else {
return MediaInformation(properties);
}
});
} on PlatformException catch (e, stack) {
debugPrint("Plugin from error: ${e.message}");
return Future.error("from failed.", stack);
}
}