From 11b79975a73d37432aca16072cf5fbcd18fa91ef Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Sat, 19 Sep 2026 15:41:09 -0700 Subject: [PATCH] transcoding: the timescale comes from the relabelled catalog On the first output for a rendition name the events were relabelled but the catalog in hand was the old one, so the track lookup missed, the timescale read as zero and the rendition was retimed in the source's units. The catalog is recomputed from the relabelled events first. Reported by Greptile on #1283. --- pkg/media/transcode_video.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/media/transcode_video.go b/pkg/media/transcode_video.go index 73d3ffa4..ebd6aca1 100644 --- a/pkg/media/transcode_video.go +++ b/pkg/media/transcode_video.go @@ -203,6 +203,12 @@ func (mm *MediaManager) canonicalRenditionTrack(ctx context.Context, r Rendition if err != nil { return nil, 0, fmt.Errorf("unwrap relabelled: %w", err) } + // The catalog is the relabelled one from here on, or the lookup + // below misses the track and the rendition is retimed in the + // source's timescale. + if cat, _ = catalogAndTracks(events); cat == nil || cat.Video == nil { + return nil, 0, fmt.Errorf("no video track in relabelled rendition") + } } var timescale uint32 for _, v := range cat.Video.Renditions { -- 2.51.2