mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-20 21:48:06 +02:00
perf: implement robust playback stabilization to fix choppy video
- Increased MPEG-TS stashInitialSize to 1MB for better jitter resistance - Enabled HLS.js discontinuity nudging to prevent freezing on corrupt segments - Smoothed latency chasing with 1.1x playback rate - Increased HLS sync distance to 6 segments for improved stability
This commit is contained in:
1 parent
bb8978efaa
commit
a8d2a5446d
3 files changed
+27
-14
No files matched your search
+5
-2
@@ -253,9 +253,12 @@
|
|||||||
const isTurbo = urlParams.get('turbo') === 'true';
|
const isTurbo = urlParams.get('turbo') === 'true';
|
||||||
|
|
||||||
const hls = new Hls({
|
const hls = new Hls({
|
||||||
maxBufferLength: isTurbo ? 45 : 50,
|
maxBufferLength: 60,
|
||||||
enableWorker: true,
|
enableWorker: true,
|
||||||
liveSyncDurationCount: isTurbo ? 3 : 4, // Improved stability
|
liveSyncDurationCount: 5, // Balanced for desktop
|
||||||
|
nudgeOffset: 0.2,
|
||||||
|
nudgeMaxRetries: 10,
|
||||||
|
maxLiveSyncPlaybackRate: 1.1,
|
||||||
// Turbo-Start specific
|
// Turbo-Start specific
|
||||||
startLevel: isTurbo ? 0 : -1,
|
startLevel: isTurbo ? 0 : -1,
|
||||||
initialLiveManifestSize: 1,
|
initialLiveManifestSize: 1,
|
||||||
|
|||||||
+14
-8
@@ -245,12 +245,16 @@
|
|||||||
const isTurbo = urlParams.get('turbo') === 'true';
|
const isTurbo = urlParams.get('turbo') === 'true';
|
||||||
|
|
||||||
const hls = new Hls({
|
const hls = new Hls({
|
||||||
maxBufferLength: isTurbo ? 45 : 60,
|
maxBufferLength: 60, // Increased for stability
|
||||||
maxMaxBufferLength: isTurbo ? 90 : 120,
|
maxMaxBufferLength: 120,
|
||||||
enableWorker: true,
|
enableWorker: true,
|
||||||
liveSyncDurationCount: isTurbo ? 3 : 5, // Improved stability
|
liveSyncDurationCount: 6, // More distance from live edge (TiviMate style)
|
||||||
liveMaxLatencyDurationCount: isTurbo ? 15 : 20,
|
liveMaxLatencyDurationCount: 20,
|
||||||
lowLatencyMode: true,
|
lowLatencyMode: true,
|
||||||
|
// Robustness features
|
||||||
|
nudgeOffset: 0.2, // Jump over discontinuities
|
||||||
|
nudgeMaxRetries: 10,
|
||||||
|
maxLiveSyncPlaybackRate: 1.1, // Smooth catch-up
|
||||||
// Turbo-Start specific
|
// Turbo-Start specific
|
||||||
startLevel: isTurbo ? 0 : -1,
|
startLevel: isTurbo ? 0 : -1,
|
||||||
initialLiveManifestSize: 1,
|
initialLiveManifestSize: 1,
|
||||||
@@ -292,12 +296,14 @@
|
|||||||
url: url
|
url: url
|
||||||
}, {
|
}, {
|
||||||
enableWorker: true,
|
enableWorker: true,
|
||||||
stashInitialSize: isTurbo ? 512 * 1024 : 1024 * 1024, // 512KB for better stability
|
stashInitialSize: isTurbo ? 1024 * 1024 : 1024 * 1024, // 1MB Large buffer for everyone
|
||||||
enableStashBuffer: true, // Re-enable stash buffer for stability
|
enableStashBuffer: true,
|
||||||
liveBufferLatencyChasing: true, // Correct drift
|
liveBufferLatencyChasing: true,
|
||||||
liveBufferLatencyChasingOnPaused: true,
|
liveBufferLatencyChasingOnPaused: true,
|
||||||
|
liveBufferLatencyMaxLatency: 3.0, // Safety margin
|
||||||
|
liveBufferLatencyMinLatency: 1.0,
|
||||||
lazyLoad: false,
|
lazyLoad: false,
|
||||||
maxStashSize: 1024 * 1024 // 1MB Max
|
maxStashSize: 2 * 1024 * 1024 // 2MB Max
|
||||||
});
|
});
|
||||||
|
|
||||||
player.attachMediaElement(video);
|
player.attachMediaElement(video);
|
||||||
|
|||||||
@@ -231,12 +231,16 @@
|
|||||||
const isTurbo = urlParams.get('turbo') === 'true';
|
const isTurbo = urlParams.get('turbo') === 'true';
|
||||||
|
|
||||||
const hls = new Hls({
|
const hls = new Hls({
|
||||||
maxBufferLength: isTurbo ? 45 : 60,
|
maxBufferLength: 60,
|
||||||
maxMaxBufferLength: isTurbo ? 90 : 120,
|
maxMaxBufferLength: 120,
|
||||||
liveSyncDurationCount: isTurbo ? 3 : 5, // Improved stability
|
liveSyncDurationCount: 6,
|
||||||
liveMaxLatencyDurationCount: isTurbo ? 15 : 20,
|
liveMaxLatencyDurationCount: 20,
|
||||||
enableWorker: true,
|
enableWorker: true,
|
||||||
lowLatencyMode: true,
|
lowLatencyMode: true,
|
||||||
|
// Robustness
|
||||||
|
nudgeOffset: 0.2,
|
||||||
|
nudgeMaxRetries: 10,
|
||||||
|
maxLiveSyncPlaybackRate: 1.1,
|
||||||
// Turbo-Start specific
|
// Turbo-Start specific
|
||||||
startLevel: isTurbo ? 0 : -1,
|
startLevel: isTurbo ? 0 : -1,
|
||||||
initialLiveManifestSize: 1,
|
initialLiveManifestSize: 1,
|
||||||
|
|||||||
Reference in new issue
Block a user