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.1k stars 1.67k forks source link

Video Skips First Few Seconds When Using DASH Streaming #3338

Closed Ulsah closed 4 years ago

Ulsah commented 4 years ago

3335 ### Environment

Description

I'm developing a e learning platform that needs video streaming. I user vuejs and laravel for backend. I use DASH streaming to play videos. I use video js with dash.js a videojs-contrib-dash packages. When I try to stream the player skips first few seconds of the video and plays flawlessly. I tested the same source .mpd file in VLC media player and it played with no issues. Can someone please point me in the right direction?

Steps to reproduce
  1. Use ffmpeg to segment videos into 480p and 720p chunks and generate the .mpd file
  2. Pass the .mpd file as source to video.js src attribute and type as application/dash+xml
  3. Try playing the video
Observed behaviour

Video plays after buffering for few seconds from the passed time location

Additional Information

Here's the code I use in vue js:

// Video Options videoOptions: { autoplay: false, controls: true, preload: true, sources: [] } //Pushing source to videoOptions: // Sets video URL var source = video.link.replace('/public/', '/storage/'); var url = 'http://localhost:8000'+source+'video.mpd'; // The src and type attributes is added into videoOptions to be played var object = { src: url, type: 'application/dash+xml' } this.videoOptions.sources.push(object); this.videoKey += 1;

dsilhavy commented 4 years ago

Can you please host your content so we can check? Moreover, please test in plain dash.js: http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

Ulsah commented 4 years ago

We hosted a sample .mpd file on our cloud storage for you to test. Here is the link:

https://storage.cloud.google.com/know-it-282016.appspot.com//storage/testchunks/Intro%20to%20CPU.mpd

I tested it in the link given above, but it was failing because CORS requests were getting blocked. Please check the link and see what's the issue.

Thank you.

dsilhavy commented 4 years ago

@Ulsah I need a playable sample in order to help you, just looking at the manifest won't help. Please host the content and the media segments on a server with CORS enabled.

Ulsah commented 4 years ago

The content and media segments are hosted and CORS is enabled in our cloud storage. The link I provided is the is URL to the manifest file which can be used to play the content. Its the link we used to test the playing on our live server and that's where I found out the issue.

dsilhavy commented 4 years ago

@Ulsah I still see the CORS issues: Access to XMLHttpRequest at 'https://storage.cloud.google.com/know-it-282016.appspot.com//storage/testchunks/Intro%20to%20CPU.mpd' from origin 'http://reference.dashif.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. XHRLoader.js:79 GET https://storage.cloud.google.com/know-it-282016.appspot.com//storage/testchunks/Intro%20to%20CPU.mpd net::ERR_FAILED

Ulsah commented 4 years ago

I apologize. We're currently performing some maintenance on our server and storage. I will post a new link here once its finished. I will get back asap. Thank you.

Ulsah commented 4 years ago

Here is a working link https://storage.googleapis.com/know-it-282016.appspot.com//storage/public/CPU/video/1/9/streamHWvkse.mpd. I tested it in the site you've mentioned. And as I said I have to either wait or skip the first few seconds for the video to play correctly.

the-provost commented 4 years ago

Still persists

dsilhavy commented 4 years ago

@Ulsah I checked in the ref client with Firefox 79 on MacOS: http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

Video starts fine for me, please check if the problem occurs for you in the ref demo page as well. I do not have a Debian system with a Firefox 68 so I will not be able to test your environment

Ulsah commented 4 years ago

The video playback is fine now in the reference player. It wasn't earlier. Did you make any changes or perhaps is there a workaround for this issue?

There is also a discussion happening in the video.js repo. Here is the link: https://github.com/videojs/video.js/issues/6757

dsilhavy commented 4 years ago

The seek logic at startup was changed in 3.1.2, maybe that fixed your issue. If it is not working with video.js it might be related to an older version of dash.js or a different initialization of dash.js.

Ulsah commented 4 years ago

I've worked around the issue for now using an older version of video.js and video-http-streaming. If there's an update I'll post it here

dsilhavy commented 4 years ago

Ok I will close this for now as this is not an issue in the current version of dash.js