mpegts.js icon indicating copy to clipboard operation
mpegts.js copied to clipboard

Playing speed

Open boardgame1 opened this issue 2 years ago • 2 comments

When playing live stream, playing speed is a bit slow. More time is passed, more delay video. Thanks.

boardgame1 avatar Apr 01 '22 05:04 boardgame1

Same observation for live video. The delay gap is getting serious when more time is passed. I have tuned the input parameters, but no luck. Here is my code for reference, <video id="videoElement" muted="muted"> <script> if (mpegts.getFeatureList().mseLivePlayback) { var videoElement = document.getElementById('videoElement'); var player = mpegts.createPlayer({ type: 'mse', // could also be mse, mpegts, m2ts, flv isLive: true, cors: true, hasAudio: false, enableWorker: true, enableStashBuffer: false, liveBufferLatencyChasing: true, liveBufferLatencyMaxLatency: 1.5, lazyLoad: false, deferLoadAfterSourceOpen: false, autoCleanupSourceBuffer: true, url: 'http://xx.xx.xx.xx/play/video01' }); player.attachMediaElement(videoElement); player.load(); player.play(); }

ivanyim3388 avatar Jul 14 '22 08:07 ivanyim3388

FIXED: well, for me at least.... Streaming a live flv, I can confirm that if I let my browser view a live stream over the weekend, it will fall behind nearly an hour! If I minimize it it essentially pauses after about 30 seconds or so. This does NOT occur on Chrome on Linux, but does for Windows. The problem is not as bad if you "unlock" the player by interacting with it and starting audio decode.

The Fix: I added {liveBufferLatencyChasing: true} and now the problem is gone.

PyCoder040 avatar Mar 06 '23 19:03 PyCoder040