-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the audio stream duration doesn't match the video stream duration, playback will freeze at the shortest stream duration AND the 'ended' event is not triggered causing loop to fail. #230
Comments
I guess this is because of the calculation error (issue #217) |
Maybe this will help troubleshoot the problem. When video appears to be stuck, you can see there are an endless number of "timeupdate" events. The current time of each "timeupdate" event is the same even though the video state is playing. During this time, video chunks continue to download so there is no problem with internet connectivity delivering future video chunks. I have added code in the "timeupdate" handler to detect repeated calls and reload the page to re-initialize video playback. After a page reload, the same video that was previously stuck will play past the stuck point and will generate an "ended" event. |
Sometimes when the video stops playing, the total time of the video is incorrect. For example, you might see the current time at 2:11 while the video duration is then incorrect (example: 0:52). |
Can anyone speculate when a 1.3 release will be available? The problem with video stopping in mid-playback is keeping us from using this software. Thanks! |
@leo - we have been trying to stick to a 2-3 month release cycle. This is based on contribution loads and is not fixed. The 1.3 release will basically be the first pass at the refactoring, which from the results I am seeing is a big improvement across the board. My goal would be to get it out before the end of the year, perhaps some time in November? This will depend on Kirk/Mikhail and some of the other key contributors. More hands make lighter work! Have you tried the refactor branch? Does it solve the video-stoping-mid-playback problem?Playing the video in question on this player (which is based on the refactored branch I believe) result sin good termination: If so, please vote up the move to /dev branch that Kirk just distributed as that will speed up the release date of 1.3 Cheers Will On Sep 30, 2014, at 12:30 PM, Leo Lucas [email protected] wrote:
|
@wilaw - thanks for the release information! I have tried the code refactor branch. The refactor branch always fails to trigger the ended event. The release branch randomly fails to trigger the ended event. Maybe the refactor branch results will help you isolate the problem. In the refactor branch, the "playback does not continue" problem always happens near the end of the video. When you look at the "timeupdate" event you either see an endless repeat of the same currentTime of the video OR you see the currentTime count past the end of the video. Here are sample pages showing the normal and refactor branch code. Look at the F12 debug console to watch the currentTime for the video. Release branch - http://www.e-learningconsulting.com/clients/dash/page.htm I can't test the http://dashplayer.azurewebsites.net/?URL=http://www.digitalprimates.net/dash/streams/gpac/mp4-main-multi-mpd-AV-NBS.mpd video because I get a CORS error. Please let me know if I can help in any way to either isolate or resolve this bug. Thanks, Leo |
Update: of course endOfStream is called after the last segment has been appended to the buffer, not all of them. |
Fixed at f323386 |
Thanks for working on this bug! I downloaded the dash.all.js from the development branch (https://github.com/Dash-Industry-Forum/dash.js/blob/development/dash.all.js) and created a sample page. The video now plays from start to finish (in 5 tests I conducted). But the "ended" event does not get fired. In my sample, I added code to write the currentTime to the console when the timeupdate event is triggered. You can see that the ended is not triggered in most cases. And currentTime will frequently go past the end of the video duration. Please see my sample code at http://www.e-learningconsulting.com/clients/dash/page-230.htm |
It looks like dash.all.js that you used in your sample was not updated after the fix. I have just updated the min files, so it should work now. Could you please try it it again using the updated dash.all.js and let me know if everything is okay. |
I downloaded the updated dash.all.js and it fixes the problem with the ended event and the video plays from beginning to end. I updated the code here - http://www.e-learningconsulting.com/clients/dash/page-230.htm. Thanks for the super-quick response! |
We did some more testing using the new dash.all.js. If you move the scrubber bar you can get JavaScript errors OR the video gets stuck at 49 seconds. An easy repro case is let the video play to the end and then replay the video from the beginning and move the scrubber bar. Pressing the "Load Video" button will also generate different JavaScript errors. I think the cause of both errors is the need to reset properties when video playback is complete. |
Please open a new issue for this Kirk Developer |
I am reopening this issue as the solution implemented fails with certain streams. Looks like we are not fully playing out the stream. When this happens this also impeds the loop property on a video element from working as well. Looks like singleComplete is happening too early in certain cases. |
Also fails with http://dash.edgesuite.net/envivio/dashpr/clear/Manifest.mpd At the end, it tries to request a segment that does not exist. FragmentLoader.js:168 GET http://dash.edgesuite.net/envivio/dashpr/clear/video5/65.m4s 404 (Not Found) |
Here is what I have found - in the following stream
Video representation has 27 segments where the last one has At the same time audio has 28 segments where the last one has When SameTimeRequestRule tries to find a match video request for the last audio request (the one with startTime= 161.28), it fails because there is no video request for which As a result the last audio segment is never loaded => isBufferingCompleted is never true => at the end of the playback hasSufficientBuffer turns false and the playback stalls. Some time ago I came across a similar issue: The main question here is what is an acceptable deviation of actual duration from the duration declared in the mpd. Still have no answer for this. Regarding |
I think in this case we need to implement some practical guidelines. Options
Consider the case of a video adaption set that has 10s segments and an audio set that has 2s segments. For a 60s clip, there would be 6 video segments to retrieve and 30 audio segments. After the last video segment is requested at the 50s mark, there would still need to be 4 more audio segments requested. My preference would be for #2 as that way we do feed all the available data to the source buffer. To answer your question “ what is an acceptable deviation of actual duration from the duration declared in the mpd.”, the DASH-AVC/264 guidelines allow any segment to deviate by 50% from the declared segmentDuration. Additionally, no restraints on placed on the duration of the last segment of any representation. Here is the exact wording: Segments have almost equal duration. The maximum tolerance of segment duration is ±50% and the maximum accumulated deviation over multiple segments is ±50% of the signaled segment duration (i.e. the @duration attribute or the S@d in the SegmentTimeline). Such fluctuations in actual segment duration may be caused by for example ad replacement or specific IDR frame placement. Note that the last segment in a representation may be shorter according to ISO/IEC 23009-1 [1]. So it does not declare that there must always be an audio segment for every video segment, or vice versa and if we have any logic that assumes this then we should remove it from the player. Cheers Will On Jan 29, 2015, at 4:29 AM, KozhinM [email protected] wrote:
|
I believe that dash.js handles such cases correctly, but the issue that we are discussing here is a bit different.
Turned out my question was not clear. I am aware of a tolerance of segment duration, I am not sure about duration of the whole representation. I mean what is the |
@KozhinM - ok, I understand now. Let me pose this question to the author of the DASH spec and the DASH IF interop group and get an answer for you. Cheers Will On Jan 29, 2015, at 11:48 PM, KozhinM <[email protected]mailto:[email protected]> wrote: Turned out my question was not clear. I am aware of a tolerance of segment duration, I am not sure about duration of the whole representation. I mean what is the delta = @mediaPresentationDuration - sum(seg1.duration + [seg2.duration, …, lastSeg.duration]). |
@wilaw, Thanks! I will be waiting for a response. |
@wilaw, @AkamaiDASH, I made a fix for this. It is here: |
@KozhinM - I'll let Dan test that fix. I did promise earlier in the thread to get a ruling on this from the DASh IF. I wanted to relay some info that I got back. I put there following diagram together to explain the various cases which can arise when duration gaps that may exist for a static manifest between video, audio and the advertised duration (shown by the red lines). Of the cases below ALL are valid EXCEPT cases #7 and #8. This is somewhat of a surprise to me and I wondered if the current dash.js code base can cope with these? DASH-AVC/264 does not define a threshold for what the size of these gaps may be. The primary take-away is that it is not true that there is always a video segment and an audio segment to describe any time point between t-0 and t=@mediaPresentationDuration. I was wondering if the logic in the SameTimeRequestRule needs to be altered to match that fact? Cheers Will [cid:5E623250-84B4-4793-8BB3-327CA1152A53] From: KozhinM <[email protected]mailto:[email protected]> @wilawhttps://github.com/wilaw, @AkamaiDASHhttps://github.com/AkamaiDASH, I made a fix for this. It is here: Reply to this email directly or view it on GitHubhttps://github.com//issues/230#issuecomment-76178551. |
@wilaw, the diagram you mentioned is not displayed. Could you please re-post it here or send it directly to my email? Once I get it I will be able to say if dash.js satisfies all the valid cases in in the diagram. |
Works for my test stream and I get the ended event every time now. Works on the reporters stream @KozhinM ill have you close once you commit to project. Thanks for the fix!! |
I just want to note that this bug is back on 2.0.0 release. |
In case anyone ends up in this thread wondering why their video doesn't loop with the latest released Dash.js (2.2.0), I switched to the "nightly" build of 2.3.0 and it works fine. |
Hi,
on the master branch v1.2.0 and on the development branch, when the video reaches the end and it stops playing, the 'ended' event from the video tag is never triggered.
I believe the reason is the fact that the video never reaches the end.
Example:
By using the Segment List mpd (http://www.digitalprimates.net/dash/streams/gpac/mp4-main-multi-mpd-AV-NBS.mpd) when the video reaches the end and stops it never stops in the end.
I am providing a screenshot:
The text was updated successfully, but these errors were encountered: