Update the position of opts to fix bugs

This commit is contained in:
Jerome Wu 2019-12-20 13:51:42 +08:00
parent 83c5107d92
commit 568061c689
2 changed files with 4 additions and 4 deletions

View File

@ -108,7 +108,7 @@ module.exports = (_options = {}) => {
const transcode = (input, output, opts = '', del = true, jobId) => ( const transcode = (input, output, opts = '', del = true, jobId) => (
run( run(
`${opts} -i /data/${input} ${output}`, `-i /data/${input} ${opts} ${output}`,
{ input, output, del }, { input, output, del },
jobId, jobId,
) )
@ -116,7 +116,7 @@ module.exports = (_options = {}) => {
const trim = (input, output, from, to, opts = '', del = true, jobId) => ( const trim = (input, output, from, to, opts = '', del = true, jobId) => (
run( run(
`${opts} -i /data/${input} -ss ${from} -to ${to} ${output}`, `-i /data/${input} -ss ${from} -to ${to} ${opts} ${output}`,
{ input, output, del }, { input, output, del },
jobId, jobId,
) )
@ -125,7 +125,7 @@ module.exports = (_options = {}) => {
const concatDemuxer = async (input, output, opts = '', del = true, jobId) => { const concatDemuxer = async (input, output, opts = '', del = true, jobId) => {
const text = input.reduce((acc, path) => `${acc}\nfile ${path}`, ''); const text = input.reduce((acc, path) => `${acc}\nfile ${path}`, '');
await writeText('concat_list.txt', text); await writeText('concat_list.txt', text);
return run(`${opts} -f concat -safe 0 -i /data/concat_list.txt -c copy ${output}`, return run(`-f concat -safe 0 -i /data/concat_list.txt -c copy ${opts} ${output}`,
{ del, output, input: [...input, 'concat_list.txt'] }, { del, output, input: [...input, 'concat_list.txt'] },
jobId); jobId);
}; };

View File

@ -57,7 +57,7 @@ const run = async ({
}, },
}, },
}, res) => { }, res) => {
const args = [...defaultArgs, ..._args.trim().split(' ')]; const args = [...defaultArgs, ..._args.trim().split(' ')].filter((s) => s.length !== 0);
ffmpeg(args.length, strList2ptr(Module, args)); ffmpeg(args.length, strList2ptr(Module, args));
/* /*