| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Many IPTV providers periodically tear down long-lived HTTP stream connections. Without in-process reconnect, ffmpeg exits and the whole buffer pipeline restarts, which shows up client-side as a freeze or a short loop. ffmpeg's -reconnect family of options fixes that class of drop by reconnecting inside the same process/output timeline. But field testing against a real provider surfaced a worse failure mode on some servers: on every new connection the server replays the last ~30 seconds of content as a catch-up backlog. With in-process reconnect that replay is spliced into the same continuous timeline, so the client visibly loops or jumps back over content it already played. Without the flags, the process exit + buffer-layer restart produces a clean (if slightly more abrupt) timeline instead - a smaller failure than the splice-loop. Since the right answer depends on how a given server behaves after a dropped connection, and there's no reliable way to detect that up front, this should not be an unconditional default. This commit documents the option as a comment next to System.FFmpeg.DefaultOptions instead of adding it to the default string, so operators can opt in after confirming their source doesn't replay backlog on reconnect. No functional change to the default; System.FFmpeg.DefaultOptions is unchanged from what ships today.
| Back | FazBrowse Home | New Git URL |
Title: Document ffmpeg reconnect options as opt-in for unstable HTTP sources
Problem
Many IPTV providers periodically tear down long-lived HTTP stream connections (session rotation, load-balancer timeouts, CDN failover). With the current default ffmpeg options there is no in-process reconnect: when the provider closes the connection, ffmpeg exits, the whole buffer pipeline restarts, and client-side segmenters (Plex/Jellyfin live TV) render the discontinuity as a freeze or a short cut every time it happens.
ffmpeg's HTTP reconnect options address that class of drop:
With these, ffmpeg re-establishes the connection inside the same process, so the output timeline stays continuous instead of the buffer layer restarting the stream.
Field caveat (why this is opt-in, not a default)
Testing against a real provider surfaced a worse failure mode on some servers: on every new connection the server replays the last ~30 seconds of content as a catch-up backlog. With in-process reconnect, that replay gets spliced into the same continuous output timeline — the client visibly loops or jumps back over content it already played, on every reconnect.
Without the reconnect flags, a dropped connection makes ffmpeg exit and the buffer layer restarts the stream: a brief cut, but a clean timeline. On servers with backlog-replay behavior, that's the smaller failure of the two.
Since the right choice depends on how a given upstream server behaves after a dropped connection, and there's no reliable way to detect that ahead of time, this should not be an unconditional default for every install.
Change (revised from the original proposal)
The original version of this PR added the reconnect flags directly to System.FFmpeg.DefaultOptions. This revision does not change the default — System.FFmpeg.DefaultOptions is left exactly as it ships today. Instead, src/config.go gets a comment next to the default documenting the reconnect flags, when to add them, and the backlog-replay caveat above, so operators can opt in deliberately after confirming their source doesn't replay backlog on reconnect (Settings > FFmpeg options).
Effect on existing/new installs
None — this is a documentation-only change (a code comment). No behavior changes for any install, new or existing.
Related: #659 touches the same default string; unaffected by this change since the default itself is untouched here.