mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
[PR #15699] Fix: Add FFmpeg reconnect flags for HTTP VOD streams to improve stability #14215
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#14215
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?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/15699
Author: @martenumberto
Created: 12/2/2025
Status: 🔄 Open
Base:
release-10.11.z← Head:fix-ffmpeg-http-reconnect📝 Commits (3)
71b170fFix: Add FFmpeg reconnect flags for HTTP streams54325f3Fix: Add FFmpeg reconnect flags for HTTP streams (Static Streams)499ea99Contributors.md📊 Changes
2 files changed (+6 additions, -0 deletions)
View changed files
📝
CONTRIBUTORS.md(+1 -0)📝
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs(+5 -0)📄 Description
Describe the bug
Currently, Jellyfin playback stops immediately if an HTTP stream connection drops, times out, or is closed by the server/proxy prematurely (TCP FIN/RST).
This behavior is particularly problematic for:
ffmpeginterprets as a validEOF(End of File), causing the movie to stop halfway.Logs typically show
Stream ends prematurelyfollowed by a clean exit of ffmpeg, leaving the user with a stopped video.The Solution
This PR adds standard
ffmpegreconnect flags to the input arguments inEncodingHelper.cs.Logic Changes:
Http(which in Jellyfin handles bothhttp://andhttps://).IsInfiniteStreamisfalse. This ensures that Live TV logic (Tuners/M3U Live) remains untouched to prevent interference with existing live buffer mechanisms.Added Flags:
-reconnect 1: Retry connection on failure.-reconnect_at_eof 1: Critical fix: Retry if the stream ends before the expected duration/header length (fixes "premature EOF" issues).-reconnect_streamed 1: Allow reconnection for streamed data.-reconnect_delay_max 30: Sets a generous max delay (30s) to allow upstream proxies or gateways enough time to recover or switch routes.Testing Done
Stream ends prematurely.Will reconnect at ..., successfully re-established the connection, and playback continued to the end of the file without user intervention.Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.