video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.85k stars 2.58k forks source link

hls link plays distorted #1305

Closed kunalbhatia closed 7 years ago

kunalbhatia commented 7 years ago

Hi Team,

The link below plays distorted, we've checked it on the demo page.

http://hungama.bc-s.cdn.bitgravity.com/cdn/_definst_/hungama/secure/audio/d/d6/amlst:27707469_,b96_a2,b128_a2,b196_a2,.mp4.smil/playlist.m3u8?e=1505204238%26h=56862e252535a1a6f3334789d68ba7fe%26bgsecuredir=1

We checked this link on several other players, out of them this below player plays it fine.

http://demo.theoplayer.com/test-your-stream-with-statistics?url=http://hungama.bc-s.cdn.bitgravity.com/cdn/_definst_/hungama/secure/audio/d/d6/amlst:27707469_,b96_a2,b128_a2,b196_a2,.mp4.smil/playlist.m3u8?e=1505204238%26h=56862e252535a1a6f3334789d68ba7fe%26bgsecuredir=1

Please, can you let us know, what attribute changes are to be done to make this link play fine on our hls.js

mangui commented 7 years ago

your audio timestamps are not increasing monotonically as expected: you can check audio timestamps of the first fragment using ffmpeg :

 ffprobe -i "http://hungama.bc-s.cdn.bitgravity.com/cdn/_definst_/hungama/secure/audio/d/d6/amlst:27707469_,b96_a2,b128_a2,b196_a2,.mp4.smil/media_w887203207_b196000_1.ts?e=1505204238%26h%3D56862e252535a1a6f3334789d68ba7fe%26bgsecuredir%3D1" -show_packets -print_format csv > audio.csv

see below. to workaround this, hls.js sorts all audio samples per PTS, then drop overlapping audio frames. and inject silent audio frame if there is any hole in the timestamps.

this explains why you can hear these glitches. I dont know how TheoPlayer is dealing with that. maybe just appending all audio frames without resorting them. we cant do that as it will break other streams...

image

kunalbhatia commented 7 years ago

@mangui,Thanks for your feedback, now we can and will report this issue to the concerned team.