From 653d6b9936c82f4a09e5e197347b31ebbaa9ff6d Mon Sep 17 00:00:00 2001 From: rarosalion Date: Sun, 11 Feb 2018 23:07:25 +1100 Subject: [PATCH] Now copies subtitles, too (#66) The exiting version drops subtitle streams. Added flags to ffmpeg to copy subtitles (if they exist) --- src/ffmpeg.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ffmpeg.js b/src/ffmpeg.js index 0dd2782c..b2aa3d38 100644 --- a/src/ffmpeg.js +++ b/src/ffmpeg.js @@ -68,7 +68,7 @@ async function cut(customOutDir, filePath, format, cutFrom, cutTo, rotation, onP const cutFromArgs = cutFrom === 0 ? [] : ['-ss', cutFrom]; const rotationArgs = rotation !== undefined ? ['-metadata:s:v:0', `rotate=${rotation}`] : []; const ffmpegArgs = [ - '-i', filePath, '-y', '-vcodec', 'copy', '-acodec', 'copy', + '-i', filePath, '-y', '-vcodec', 'copy', '-acodec', 'copy', '-scodec', 'copy', ...cutFromArgs, '-t', cutTo - cutFrom, '-map_metadata', '0', ...rotationArgs,