zoriya / Kyoo

A portable and vast media library solution.
https://kyoo.zoriya.dev
GNU General Public License v3.0
1.66k stars 38 forks source link

Fix video miss-cut because of start offset #505

Closed zoriya closed 4 months ago

zoriya commented 4 months ago

Sometimes, videos can start at a timing greater than 0:00. We need to take that into account and only list keyframes that come after the start of the video (without that, our segments count mismatch and we can have the same segment twice on the stream).

We can't hardcode the first keyframe at 0 because the transcoder needs to reference durations of segments. To handle this edge case, when we fetch the segment n0, no seeking is done but duration is computed from the first keyframe (instead of 0)