getExecuteConfig method

  1. @override
Future<FFmpegVideoEditorExecute?> getExecuteConfig()
override

Returns a FFmpegVideoEditorExecute command to be executed with FFmpeg to export the cover image applying the editing parameters.

Implementation

@override
Future<FFmpegVideoEditorExecute?> getExecuteConfig() async {
  // file generated from the thumbnail library or video source
  final String? coverPath = await _generateCoverFile();
  if (coverPath == null) {
    debugPrint('VideoThumbnail library error while exporting the cover');
    return null;
  }
  final String outputPath =
      await getOutputPath(filePath: coverPath, format: format);
  final List<String> filters = getExportFilters();

  return FFmpegVideoEditorExecute(
    command: commandBuilder != null
        ? commandBuilder!(this, "\'$coverPath\'", "\'$outputPath\'")
        // use -y option to overwrite the output
        : "-i \'$coverPath\' ${filtersCmd(filters)} -y \'$outputPath\'",
    outputPath: outputPath,
  );
}