From 2877083ebe6734af26fba6556b1cde9802719742 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sat, 10 Feb 2024 21:54:52 +0100 Subject: [PATCH] Fix missing last segment --- transcoder/src/stream.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/transcoder/src/stream.go b/transcoder/src/stream.go index dec0c47f..ccec171c 100644 --- a/transcoder/src/stream.go +++ b/transcoder/src/stream.go @@ -135,9 +135,13 @@ func (ts *Stream) run(start int32) error { "-ss", fmt.Sprintf("%.6f", ts.file.Keyframes[start]), "-i", ts.file.Path, - "-to", fmt.Sprintf("%.6f", ts.file.Keyframes[end]), "-copyts", } + if end != int32(len(ts.file.Keyframes)-1) { + args = append(args, + "-to", fmt.Sprintf("%.6f", ts.file.Keyframes[end]), + ) + } args = append(args, ts.handle.getTranscodeArgs(segments_str)...) args = append(args, []string{ "-f", "segment",