mirror of
https://github.com/C4illin/ConvertX.git
synced 2026-06-27 22:45:48 +00:00
fix: add FFMPEG_OUTPUT_ARGS (#470)
This commit is contained in:
@@ -730,11 +730,14 @@ export async function convert(
|
||||
|
||||
// Parse FFMPEG_ARGS environment variable into array
|
||||
const ffmpegArgs = process.env.FFMPEG_ARGS ? process.env.FFMPEG_ARGS.split(/\s+/) : [];
|
||||
const ffmpegOutputArgs = process.env.FFMPEG_OUTPUT_ARGS
|
||||
? process.env.FFMPEG_OUTPUT_ARGS.split(/\s+/)
|
||||
: [];
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
execFile(
|
||||
"ffmpeg",
|
||||
["-i", filePath, ...ffmpegArgs, ...extraArgs, targetPath],
|
||||
[...ffmpegArgs, "-i", filePath, ...ffmpegOutputArgs, ...extraArgs, targetPath],
|
||||
(error, stdout, stderr) => {
|
||||
if (error) {
|
||||
reject(`error: ${error}`);
|
||||
|
||||
Reference in New Issue
Block a user