From e40f53c18b5e878dbc793543ddab3d46a29555fe Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 13 Nov 2022 22:08:14 -0800 Subject: [PATCH] Fix keyframe alignment --- stream.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stream.go b/stream.go index 040fa531..5ca108e1 100644 --- a/stream.go +++ b/stream.go @@ -268,6 +268,11 @@ func (s *Stream) restartAtChunk(w http.ResponseWriter, id int) { } func (s *Stream) transcode(startId int) { + if startId > 0 { + // Start one frame before + // This ensures that the keyframes are aligned + startId-- + } startAt := float64(startId * s.c.chunkSize) args := []string{