mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2026-03-02 22:57:11 -05:00
HLS Segment Renaming #6457
Labels
No labels
Component: Accessibility
Component: Administration
Component: Auth
Component: CLI
Component: Channels
Component: Chapters
Component: Comments
Component: Custom Markdown
Component: Docker 🐳
Component: Documentation 📚
Component: Email
Component: Embed
Component: Federation 🎡
Component: Import/Export
Component: Live
Component: Metadata
Component: Mobile
Component: Moderation :godmode:
Component: Notifications
Component: Object storage
Component: Observability
Component: PeerTube Plugin 📦
Component: Player ⏯️
Component: Playlist
Component: Recommendation
Component: Redundancy
Component: Registration
Component: Runners
Component: SEO
Component: Search
Component: Security
Component: Stats
Component: Studio
Component: Studio
Component: Subscriptions
Component: Subtitles 💬
Component: Transcoding
Component: Upload
Component: Video Import
Component: i18n 🔡
Priority: High
Priority: Low
Priority: Roadmap
Status: Blocked ✋
Status: In Progress 🔜
Status: To Reproduce
Status: Waiting for answer
Template not filled
Type: Bug 🐛
Type: Discussion 💭
Type: Discussion 💭
Type: Duplicate ➿
Type: Feature Request ✨
Type: Maintenance 👷♀️
Type: Performance
Type: Question
UI
good first issue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/PeerTube#6457
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MattyBoombalatty on GitHub (Feb 10, 2026).
Describe the problem to be solved
For individuals who want to use a CDN/S3 bucket to serve their data, S3 egress costs are usually very high regardless of provider, so aggressive CDN caching is required. The issue with PeerTube is that HLS segments cannot be cached for a long time in terms of permanent lives because the path to the HLS segment remains the same, only the playlist file is updated. This means that if a stream is cut off or stops and then is restarted in the period of time the
.tssegments are cached, viewers will be served stale data.Example:
Describe the solution you would like
I believe the best solution to this would be to add a unique session key to the HLS segments, so
.tsfiles can be considered immutable and not subject to being served as stale data for permanent lives, restarted livestreams, et cetera. This fix is simple, in my opinion./packages/ffmpeg/src/ffmpeg-live.tsThe HLS segment would then be named something like
*-1707500000-000001.ts. When a permanent live is restarted, a newsessionTokenis generated, bypassing stale cache data without the user having to create a new Live (generating a new UUID), enabling administrators to more aggressively cache HLS segments.