[PR #11161] Fix the fragile segment deletion #12757

Closed
opened 2026-02-07 07:01:18 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/jellyfin/jellyfin/pull/11161

State: closed
Merged: Yes


Changes

  • Add TranscodingSegmentCleaner to replace ffmpeg's hlsenc deletion

FFmpeg deletes segments based on its own transcoding progress,
but we need to delete segments based on client download progress.
Since disk and GPU speeds vary, using hlsenc's built-in deletion
will result in premature deletion of some segments. As a consequence,
the server has to constantly respin new ffmpeg instances, resulting
in choppy video playback.

  • Add sanity check for ThrottleDelaySeconds
  • Set input readrate for using SegmentDeletion with stream-copy

Issues

  • The old implementation just happened to work. It's actually very fragile and can easily break playback by just entering some smaller SegmentKeepSeconds value.
**Original Pull Request:** https://github.com/jellyfin/jellyfin/pull/11161 **State:** closed **Merged:** Yes --- **Changes** - Add `TranscodingSegmentCleaner` to replace ffmpeg's hlsenc deletion FFmpeg deletes segments based on its own transcoding progress, but we need to delete segments based on client download progress. Since disk and GPU speeds vary, using hlsenc's built-in deletion will result in premature deletion of some segments. As a consequence, the server has to constantly respin new ffmpeg instances, resulting in choppy video playback. - Add sanity check for `ThrottleDelaySeconds` - Set input `readrate` for using SegmentDeletion with stream-copy **Issues** - The [old implementation](https://github.com/jellyfin/jellyfin/pull/8744) just happened to work. It's actually very fragile and can easily break playback by just entering some smaller `SegmentKeepSeconds` value.
OVERLORD added the pull-request label 2026-02-07 07:01:18 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#12757