export static method
Implementation
static Future<bool> export(
List<TextLayer> textLayers,
int? fps,
String input,
String output,
Map<String, FontFile> fonts,
) async {
final cmd = <String>['-i', '"$input"'];
if (fps != null) cmd.addAll(['-r', '$fps']);
if (textLayers.length > 1) {
cmd.addAll([
'-filter_complex',
'"${[for (final e in textLayers) await getCMD(e, fonts)].join(',')}"'
]);
} else {
cmd.addAll(['-vf', '"${await getCMD(textLayers.first, fonts)}"']);
}
cmd.addAll(['-c:a', 'copy', '"$output"', '-y']);
return ffmpeg.execute(cmd);
}