diff --git a/clients/manifest.go b/clients/manifest.go index 99fa35cab..369fab5af 100644 --- a/clients/manifest.go +++ b/clients/manifest.go @@ -15,6 +15,7 @@ import ( "github.com/cenkalti/backoff/v4" "github.com/grafov/m3u8" + "github.com/livepeer/catalyst-api/log" "github.com/livepeer/catalyst-api/video" ) @@ -223,6 +224,7 @@ func ClipInputManifest(requestID, sourceURL, clipTargetUrl string, startTimeUnix if err != nil { return nil, fmt.Errorf("error clipping: failed to download original manifest: %w", err) } + log.Log(requestID, "Downloaded manifest to clip", "segments", origManifest.Count()) // Generate the absolute path URLS for segmens from the manifest's relative path // TODO: optimize later and only get absolute path URLs for the start/end segments diff --git a/video/clip.go b/video/clip.go index 7bd43d443..3aaf18e37 100644 --- a/video/clip.go +++ b/video/clip.go @@ -113,7 +113,7 @@ func ClipManifest(requestID string, manifest *m3u8.MediaPlaylist, startTime, end // Find the segment index that correlates with the specified startTime // but error out it exceeds the manifest's duration. if startTime > manifestDuration { - return nil, []ClipSegmentInfo{}, fmt.Errorf("error clipping: start time specified exceeds duration of manifest") + return nil, []ClipSegmentInfo{}, fmt.Errorf("error clipping: start time (%f) specified exceeds duration of manifest (%f)", startTime, manifestDuration) } else { clipStartSegmentInfo, err = getRelevantSegment(manifest.Segments, startTime, 0) if err != nil { diff --git a/video/clip_test.go b/video/clip_test.go index a27470a71..20a6c775a 100644 --- a/video/clip_test.go +++ b/video/clip_test.go @@ -150,7 +150,7 @@ func TestClippingSucceedsWhenValidManifestIsUsed(t *testing.T) { // start exceeds the duration of playlist: ensure no segments are returned segs, _, err = ClipManifest("1234", plB, 30, 20.78) - require.ErrorContains(t, err, "start time specified exceeds duration of manifest") + require.ErrorContains(t, err, "exceeds duration of manifest") require.Equal(t, segs, []*m3u8.MediaSegment(nil)) // end exceeds the duration of playlist: ensure only 0.ts is returned