videojs / videojs-contrib-hls

HLS library for video.js
http://videojs.github.io/videojs-contrib-hls/
Other
2.84k stars 791 forks source link

HLS playback problem Akamai universal streaming and MSE browsers #477

Closed many74 closed 8 years ago

many74 commented 8 years ago

Hi, Using videojs-contrib-hls v1.2.2 , Chrome ( also tested with 1.3.0 and issue still remains ) and for instance the stream http://stream.demo.bvod.tv/i/,60s.mp4,.csmil/master.m3u8 we get playback problems. The stream freezes for a couple of ms and then continue between each segement. On this particulary stream we have 2 s as segmentlength but we've tested with 10 s segments as well. It seems like we have this problem mostly using akamai univeral streaming and source files that has been transcoded from flv to mp4. The streams work fine on desktop Safari and Edge and also handheld devices such as IOS and Android. We've also tested with hls.js and there it seems to work on Chrome and finally we tested with HLS over flash and it is also working.

dmlap commented 8 years ago

@many74 that URL errors for me. Can you capture one or two TS files that are generated and link to them?

many74 commented 8 years ago

@dmlap Hmm, The URL works for me. Anyway the URL.s to the ts files are as follows . The file only has one rendition.

http://stream.demo.bvod.tv/i/,60s.mp4,.csmil/segment1_0_av.ts http://stream.demo.bvod.tv/i/,60s.mp4,.csmil/segment2_0_av.ts http://stream.demo.bvod.tv/i/,60s.mp4,.csmil/segment3_0_av.ts etc

Can you access them or do you want me to upload the ts files somewhere?

dmlap commented 8 years ago

I get errors on the TS segments as well. Would you mind uploading them somewhere else?

many74 commented 8 years ago

@dmlap Seems to be some weird dns problems. Test this one instead http://bvoddemo-vh.akamaihd.net/i/,60s.mp4,.csmil/master.m3u8 I will try to find a place to put the ts files

many74 commented 8 years ago

If the above dont work you should be able to download first 10 segements via http://segements.s3-website-eu-west-1.amazonaws.com/segment1_0_av.ts http://segements.s3-website-eu-west-1.amazonaws.com/segment2_0_av.ts http://segements.s3-website-eu-west-1.amazonaws.com/segment3_0_av.ts ..

dmlap commented 8 years ago

Ok, I think I know what's going on with this one. We currently generate an mp4 fragment for each MPEG2-TS segment you load into the player. Fragmented MP4s can't reference frames in previous fragments so if your TS file doesn't start with a keyframe, we "pull back" the first keyframe we find to the start of that segment. If you make sure your TS segments start with keyframes, this issue should go away.

For the future we're thinking about generating MP4 fragments around each keyframe, instead of at the TS segment boundary. That should get rid of this issue where our splitting makes some video data unusable. I've filed https://github.com/videojs/mux.js/issues/45 to track that.

hc2p commented 8 years ago

@many74 did you find a solution to your problem?

khueue commented 8 years ago

On behalf of many74, no, not really. Our workaround will probably be to re-encode the videos that cause this behavior (with keyframes configured properly).

dmlap commented 8 years ago

We have a PR open now to address this issue: https://github.com/videojs/mux.js/pull/57. If that (or something like it) gets accepted and merged, the keyframe-segmentation restriction will no longer be necessary.