From 42e9e0d12248e3cc09e49dea9941b4996fc9e1fc Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sat, 25 Apr 2020 16:37:25 +0800 Subject: [PATCH] improve stream selection --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index ed66433..c39d5a9 100644 --- a/index.js +++ b/index.js @@ -264,6 +264,7 @@ module.exports = async (config = {}) => { '-movflags', 'faststart', '-y', outPath, ]; + const args = [ ...(enableFfmpegLog ? [] : ['-hide_banner', '-loglevel', 'panic']), @@ -275,6 +276,10 @@ module.exports = async (config = {}) => { '-i', '-', ...(audioFilePath ? ['-i', audioFilePath, '-shortest'] : []), + + '-map', '0:v:0', + ...(audioFilePath ? ['-map', '1:a:0'] : []), + ...(audioFilePath ? ['-acodec', 'aac', '-b:a', '128k'] : []), ...outputArgs,