Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.15k stars 1.68k forks source link

Dynamic timeshift video freeze, can not play through. #2170

Closed EurekaWoo closed 7 years ago

EurekaWoo commented 7 years ago
With dash.js, I can play live video smoothly, bu can not play timeshift well, it freedze after some secondes. 

Video.buffered has several ranges, and the video stops at the gap, why this and is there any way for dash.js to igore the framgent gap and play over the gap?

Console output```

The conlog is as follwing: [1079] Buffered Range for type: audio : 17545044.008 - 17545068.007999 [1081] ThroughputRule requesting switch to index: 0 type: audio Average throughput 9785 kbps [1081] AbrController (audio) stay on 0/0 (buffer: 0) [1081] ScheduleController - getNextFragment [1082] Prior to making a request for time, NextFragmentRequestRule is aligning index handler's currentTime with bufferedRange.end. 17545068 was changed to 17545068.007999 [1084] Getting the request for audio time : 17545068.007999 [1085] Index for audio time 17545068.007999 is 599 [1085] SegmentTimeline: 17545062 / Infinity [1086] Getting the next request at index: 600 [1087] No segment found at index: 600. Wait for next loop [1087] getNextFragment - Playing at the bleeding live edge and frag is not available yet [2245] Buffered Range for type: video : 17545044.92 - 17545049.92 Buffered Range for video---------- now:0 [2247] Requesting seek to time: 17545044.92 [2249] Seeking to: 17545044.92 [2251] Got enough buffer to start. [2252] AbrController (audio) switching from throughput to buffer occupancy ABR rule (buffer: 23.088). [2253] Got enough buffer to start. [2254] ThroughputRule requesting switch to index: 0 type: video Average throughput 9850 kbps [2259] AbrController (video) stay on 0/0 (buffer: 5) [2259] ScheduleController - getNextFragment [2260] Prior to making a request for time, NextFragmentRequestRule is aligning index handler's currentTime with bufferedRange.end. 17545044.92 was changed to 17545049.92 [2260] Getting the request for video time : 17545049.92 [2261] Index for video time 17545049.92 is 596 [2262] SegmentTimeline: 17545044 / Infinity [2262] Getting the next request at index: 597 [2263] SegmentTimeline: 17545050 / Infinity [2263] ScheduleController - getNextFragment - request is http://41.50.5.4:6910/001/2/ch00000090990000001015/fragment-2924176-v1-x3.m…s_min=1&filedura=6&zte_offset=19700101000000-beginning-&JITPMediaType=DASH [2366] Native video element event: seeked [2366] Native video element event: playing [4484] Buffered Range for type: video : 17545044.92 - 17545049.92 [4484] Buffered Range for type: video : 17545051.28 - 17545062.28

davemevans commented 7 years ago

The gaps are occurring because the base media decode times in the segments aren't incrementing at the sample duration * number of samples: some are shorter, some are longer. This is an error with your packager, and you'd be better off fixing that than making the player skip.

Further, the IDR in each segment doesn't occur until the 26th frame, so when there is a discontinuity you also lose the first second's worth of coded frames from the next segment. Your maths somewhere probably isn't taking into account the short first segment in the timeline.

This ins't a player issue so I will close, but please feel free to reopen once you have sorted the media if you think there is a player issue.

EurekaWoo commented 7 years ago

@bbcrddave Thanks for the answer. I'll ask the packeger provider to check the problem. But I think it 's better to support this to improve the robusness like shaka did, so we can play through even with small problem with the segment. Besides, I found another problem similar to this. When playing live video with timeshit 6, I call pause method to stop playing, after one 1 minute, I call play(), but the player can not continue to play. The logs first show requet invalid fragment, the

[109086] Waiting for more buffer before starting playback. [109087] AbrController (audio) switching from buffer occupancy to throughput ABR rule (buffer: 0.000). [109087] Waiting for more buffer before starting playback. ..... then repeated [112183] ThroughputRule requesting switch to index: 1 type: video Average throughput 2313 kbps [112185] AbrController (video) stay on 1/2 (buffer: 0) [112185] ScheduleController - getNextFragment [112186] Getting the request for video time : 17769522 [112188] isMediaFinished - no segment found [112189] getNextFragment - Playing at the bleeding live edge and frag is not available yet

davemevans commented 7 years ago

See https://github.com/Dash-Industry-Forum/dash.js/pull/2102 for functionality which is probably what you are looking for in terms of skipping missing media.

I would recommend you open a new issue for the new problem since it appears to be different.

EurekaWoo commented 7 years ago

Thank you very much, I integrate the code in #2102, and it works fine now.