From fdd0794a1303e28c5177c805bf1079af65a9c318 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Tue, 21 Nov 2017 22:28:42 +0100 Subject: [PATCH] Don't cut start if start time is 0 To cause issue with black video in the beginning https://github.com/mifi/lossless-cut/issues/50 --- src/ffmpeg.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ffmpeg.js b/src/ffmpeg.js index f712b109..98450a16 100644 --- a/src/ffmpeg.js +++ b/src/ffmpeg.js @@ -64,9 +64,12 @@ async function cut(customOutDir, filePath, format, cutFrom, cutTo, onProgress) { console.log('Cutting from', cutFrom, 'to', cutTo); + // https://github.com/mifi/lossless-cut/issues/50 + const cutFromArgs = cutFrom === 0 ? [] : ['-ss', cutFrom]; + const ffmpegArgs = [ '-i', filePath, '-y', '-vcodec', 'copy', '-acodec', 'copy', - '-ss', cutFrom, '-t', cutTo - cutFrom, + ...cutFromArgs, '-t', cutTo - cutFrom, '-map_metadata', '0', '-f', format, outPath,