K-S-V / Scripts

Collection of my scripts
GNU General Public License v3.0
634 stars 226 forks source link

AdobeHDS Manifest.f4m Parallel Loop #79

Closed nunofmds closed 8 years ago

nunofmds commented 8 years ago

Hi,

I'm using AdobeHDS to get contents of live Manifest.f4m on VLC but for some reason I can't use more than one tread "--Parallel 1" or else I start get loops on video...like repeated stuff. Other thing I saw was when the bootstrap updates the video sometimes get frozen, it seems the server dont like to much calls at same time...

I can't post the URL where in public but I can provide it on other way if someone can help.

Best Regards

K-S-V commented 8 years ago

If the server is sending wrong fragment for parallel requests then it's server side issue. you can keep using --parallel 1 in that case if it alleviates your problem. While script is updating the bootstrap to get list of new available fragments, your player may catch up with already buffered data and you may experience freezes until new fragment is downloaded. try using the --quality low switch to check if it's due to your slow connection. it's also possible that server is limiting the download speed or just unable to keep up with the high traffic.

nunofmds commented 8 years ago

Hi, yes that's what I did. Reduce the --parallel 1 and --quality low but sometimes I get that loops...maybe there is away to detect what was played before and dont send repeated fragments? Other thing is bootstrap update I think it mess up with this because when it updates sometimes the other tread can't donwload the fragment at same time...

K-S-V commented 8 years ago

Bootstrap is updated only when all the known fragments are completely downloaded so fragment download can't interrupt bootstrap update in anyway.

nunofmds commented 8 years ago

Any change for I give you the link without post where in public?

nunofmds commented 8 years ago

Doing some debug and figure out that when I have loops I can see diferent frag id being donwloaded with http code 200 and same size! Then I have loop video and audio...

FRAG_TO_DOWNLOAD: 7 ID: 165716 HTTP: 200 SIZE: 1301400

FRAG_TO_DOWNLOAD: 6 ID: 165717 HTTP: 200 SIZE: 1301400

Something like skip or retry if the current frag downloaded it's the same that was already displayed...or try to understand why this happen.

I can reproduce the problem if needed...

K-S-V commented 8 years ago

Your log confirms that script is requesting the correct fragment but it's the server who is serving wrong fragment. there could be different ways to detect this behavior but I am not willing to introduce new changes just to accommodate one lousy server.

nunofmds commented 8 years ago

I don't think that's a lousy server problem...thinks this is a protection from it to don't allow to much requests in specific amout of time. Thanks anyway. Your script is great! ;-)

nunofmds commented 8 years ago

I just finished the fix to dont allow more repeated "WriteFragments"...I just add a simple if($lastfragresponse <> $frag['response']) before the principal $this->WriteFragment($frag, $opt); and now I can add 80000 parallel that I will never have a repeated fragment writed!

if you still want to take a look I apreciate it because I'm not an expert and this I did works but maybe you can do it better.