fix: add FFMPEG_OUTPUT_ARGS (#470)
This commit is contained in:
parent
12a5580694
commit
df3330fdc2
4 changed files with 8 additions and 4 deletions
|
|
@ -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}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue