Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clipping: search for first and last segments to clip #777

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Conversation

emranemran
Copy link
Collaborator

@emranemran emranemran commented Jul 26, 2023

Part 1 in series of Clipping related PRs.

This change adds methods to take any HLS manifest and return the start and end segments that correspond to the specified clipping timestamps.

@emranemran emranemran changed the title wip: clipping support add clipping support for vod + live + recordings Jul 28, 2023
video/clip.go Outdated Show resolved Hide resolved
@emranemran emranemran changed the title add clipping support for vod + live + recordings clipping: search for first and last segments to clip Aug 2, 2023
@emranemran emranemran marked this pull request as ready for review August 2, 2023 17:36
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #777 (30bf07d) into main (5662003) will increase coverage by 0.10839%.
The diff coverage is 67.85714%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##                main        #777         +/-   ##
===================================================
+ Coverage   58.19323%   58.30162%   +0.10839%     
===================================================
  Files             58          59          +1     
  Lines           4937        4993         +56     
===================================================
+ Hits            2873        2911         +38     
- Misses          1843        1855         +12     
- Partials         221         227          +6     
Files Changed Coverage Δ
video/clip.go 67.85714% <67.85714%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5662003...30bf07d. Read the comment docs.

Files Changed Coverage Δ
video/clip.go 67.85714% <67.85714%> (ø)

video/clip.go Outdated Show resolved Hide resolved
@emranemran emranemran force-pushed the emran/clips branch 2 times, most recently from 1f84f28 to f8ee3b2 Compare August 3, 2023 23:36
video/clip.go Outdated Show resolved Hide resolved
@emranemran
Copy link
Collaborator Author

emranemran commented Aug 5, 2023

Updates:

  • ClipManifest now returns a slice of m3u8.MediaSegment that contains all segments from the specified start time to end time
  • getRelevantSegment now returns just indices and doesn't use any pointers (even though my brain sometimes prefers passing around pointers).
  • Added back getTotalDurationAndSegments function that's useful to simplify the range loop
  • Updated tests to match the new logic

Pls re-review @thomshutt @mjh1

@emranemran emranemran force-pushed the emran/clips branch 4 times, most recently from 93c93ca to fed2232 Compare August 7, 2023 14:08
video/clip.go Outdated Show resolved Hide resolved
video/clip.go Show resolved Hide resolved
ClipManifest takes a manifest and the start/end clip times and returns
MediaSegments that correspond to those times.
@emranemran emranemran merged commit 0966990 into main Aug 7, 2023
12 checks passed
@emranemran emranemran deleted the emran/clips branch August 7, 2023 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants