invoke method
Implementation
Future<FFmpegRawResponse> invoke({
String? pathFFmpeg,
FFmpegArgs? fFmpegArgs,
String? workingDirectory,
Map<String, String>? environment,
bool includeParentEnvironment = true,
bool runInShell = false,
}) async {
fFmpegArgs ??= FFmpegArgs([]);
pathFFmpeg ??= path_ffmpeg;
ProcessResult res = await Process.run(
pathFFmpeg,
fFmpegArgs.toList(),
workingDirectory: workingDirectory,
environment: environment,
includeParentEnvironment: includeParentEnvironment,
runInShell: runInShell,
);
if (res.exitCode == 0) {
return FFmpegRawResponse(
rawData: {"@type": "ok", "message": res.stdout},
processResult: res,
);
} else {
return FFmpegRawResponse(
rawData: {"@type": "error", "message": res.stderr},
processResult: res,
);
}
}