From 36c1423ff659f8369b227523d99b0d890520358b Mon Sep 17 00:00:00 2001 From: bytedream Date: Mon, 5 Sep 2022 00:20:29 +0200 Subject: [PATCH] Fix re-encode removes video, audio and subtitle tracks (#47) --- cli/commands/archive/archive.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/commands/archive/archive.go b/cli/commands/archive/archive.go index ce53b85..63eac77 100644 --- a/cli/commands/archive/archive.go +++ b/cli/commands/archive/archive.go @@ -662,7 +662,7 @@ func archiveFFmpeg(ctx context.Context, dst io.Writer, videoFiles, audioFiles, s // this might get triggered when not needed but there is currently no easy way to // bypass this unwanted triggering if reencode { - utils.Log.Debug("Reencode to short video length") + utils.Log.Debug("Re-encode to short video length") file.Close() @@ -670,7 +670,7 @@ func archiveFFmpeg(ctx context.Context, dst io.Writer, videoFiles, audioFiles, s tmpFile.Close() errBuf.Reset() - cmd = exec.CommandContext(ctx, "ffmpeg", "-y", "-i", file.Name(), "-c", "copy", "-t", fmt.Sprintf("%02d:%02d:%02d.%d", videoLength[0], videoLength[1], videoLength[2], videoLength[3]), "-f", "matroska", tmpFile.Name()) + cmd = exec.CommandContext(ctx, "ffmpeg", "-y", "-i", file.Name(), "-c", "copy", "-map", "0", "-t", fmt.Sprintf("%02d:%02d:%02d.%d", videoLength[0], videoLength[1], videoLength[2], videoLength[3]), "-f", "matroska", tmpFile.Name()) cmd.Stderr = &errBuf if err = cmd.Run(); err != nil { return fmt.Errorf(errBuf.String())