flowplayer / flash

Flowplayer Flash, the video player for the Web
http://flowplayer.org
282 stars 181 forks source link

bwcheck + pseudostreaming: no dynamic switches, strange bwDone results #134

Closed phloxic closed 10 years ago

phloxic commented 10 years ago

http://flowplayer.blacktrash.org/test/bwcheck-pseudo.html does not do any dynamic stream switches at all.

With checkOnStart http://flash.flowplayer.org/demos/plugins/streaming/bandwidth-detection.html reports 576.6652497654785 http://flowplayer.blacktrash.org/test/bwcheck-pseudo-onstart.html reports 3246.7877970950713 for the same array of videos from the same server?! http://flowplayer.blacktrash.org/test/bwcheck-pseudo-onstart.html should also switch to the highest bitrate when going fullscreen because switchOnFullscreen is true by default - but it does not.

adammada commented 10 years ago

for the same array of videos from the same server?!

I see that check is made on flowplayer swf file, not on movies:

netConnectionUrl: "http://flowplayer.blacktrash.org/flowplayer-3.2.16.swf",

vs

netConnectionUrl: "http://releases.flowplayer.org/swf/flowplayer-3.2.16.swf",

Probably server "releases.flowplayer.org" has throttled download speeds and it will never detect higher speed no matter what internet connection we have.

danrossi commented 10 years ago

that feature is not for pseudo streaming.

phloxic commented 10 years ago

Aha. Would have been nice to mention it when I asked about it in conjunction with php-pseudostreaming to bring http://flash.flowplayer.org/plugins/streaming/bwcheck.html#features up to speed. Will update that section accordingly. bwcheck onStart will probably even work with php-pseudostreaming.

phloxic commented 10 years ago

Closing in favour of doc issue https://github.com/flowplayer/work/issues/787

danrossi commented 10 years ago

hmm as a matter of fact the netstream statistics may / may not be for http streams, ill have a look later on today what it reports but theoretically its for rtmp and then the httpstreaming one is for HDS.

phloxic commented 10 years ago

To recap:

  1. bwcheck + pseudostreaming only supports checkOnStart without fullscreen switch, i.e. as if swtichOnFullscreen was set to false - this also seems to work for php-pseudostreaming btw.
  2. bwcheck dynamic + pseudostreaming is not supported

2) begs the question why a (almost) smooth stream switch without restart is possible with bitrateselect, but not with bwcheck? Isn't the switching mechanism the same? Only the trigger mechanism would differ - or is it because listening to a "netConnectionUrl" over http does not yield meaningful results?

danrossi commented 10 years ago
  1. for psuedo the fullscreen switch is what the purpose for if its not switching for pseudo when going fullscreen thats a problem.

2) I don't understand what you mean here please explain ? Are you talking about why it doesn't work with pseudo ? Well the stats might not be available for progressive downloading, the rules are most definitely not setup for that either, issue number 2, when making a switch its simply calling the new file, add latency for http handshaking, once delivered it has to wait for a metadata event and then call a server seek, then once that is done it's not entirely seamless and good user experience ..

phloxic commented 10 years ago

I'm fine with not supporting dynamic stream switching for pseudostreaming because it's not seamless - the lack of seamlessness is not so annoying when you do a manual switch. But switchOnFullscreen is a dynamic switch - or is that seen as manual too, and doing a sort of checkOnStart with seek? ... ah, I see, it switches, but does not do a seek (restarts video). Hm. My personal config preference then would probably be: { checkOnStart: true, switchOnFullscreen: false, qos: {screen: false}}

phloxic commented 10 years ago

OK, I will update the docs - hopefully I've now sussed the behaviour.

danrossi commented 10 years ago

^ is it not attempting to change to a different file on switch to fullscreen ? Yes it should try and do a manual change to a new file if it can. This is reliant on the screen size rule though not just bandwidth settings so it will goto a bigger file on fullscreen. That size rule was a requirement added in by anssi.

phloxic commented 10 years ago

Yes, and it works - but I have to document that it restarts the video then, as this is surprising behaviour.

danrossi commented 10 years ago

Does it not seek to the current position again ?

danrossi commented 10 years ago

hmmm come to think of it I can't see why it can't request the seek position when requesting the new file. Perhaps this is what you are asking for right ? Its currently doing it once the new file has received metadata.

I believe I tried to just call the new file with the seek time but it requires metadata i think at the start of the file to begin playback properly not sure what was going on there.

adammada commented 10 years ago

Yes, and it works - but I have to document that it restarts the video then, as this is surprising behaviour.

Does it not seek to the current position again ?

Not sure, but isn't it that excactly that bug (regression) in latest (16) flowplayer core which happens in bwcheck and bitrate selection, but works in previous (15) ?

danrossi commented 10 years ago

You've lost me come again ? If its not attempting to seek back to the current position when changing the stream in fullscreen need a demo and could be a problem. Thanks.

adammada commented 10 years ago

Sorry, i meant that: https://github.com/flowplayer/flash/issues/133 , but it seeks, just after seeking plays from start.

phloxic commented 10 years ago

Demo: http://flowplayer.blacktrash.org/test/bwcheck-pseudo-onstart.html Goes back to beginning, sometimes without updating current time in controls. Looks indeed suspiciously like #133 Checking with 3.2.15 now for regression.

phloxic commented 10 years ago

Yes, indeed a regression, works with core 3.2.15 - reopening.

phloxic commented 10 years ago

Working demo with 3.2.15 core: http://flowplayer.blacktrash.org/test/bwcheck-pseudo-onstart-3215.html

danrossi commented 10 years ago

Not very latest files I believe can someone please try these

https://dl.dropboxusercontent.com/u/3394987/flowplayer.bwcheck-3.2.13-dev.zip https://dl.dropboxusercontent.com/u/3394987/flowplayer.pseudostreaming-3.2.12.zip

I believe the fix is in this.

danrossi commented 10 years ago

switchOnFullscreen: true,

you might want to enable this I think its disabled by default.

danrossi commented 10 years ago

sorry it is enabled by default I can see it doing a detection when changing from fullscreen that is fine but the returned bandwidth is less than the bitrate so just stays at 800. Its set to not switch if the same bitrate.

http://flowplayer.blacktrash.org/flowplayer-3.2.16.swf this file incurs too much latency therefore I'm only getting 280k detected here.

adammada commented 10 years ago

https://dl.dropboxusercontent.com/u/3394987/flowplayer.pseudostreaming-3.2.12.zip

Works!

danrossi commented 10 years ago

https://github.com/flowplayer/flash/pull/95 it could be part of this pull request Im afraid I can't do anything about that. Those go into the dev branch which has not made it to the master either. Thanks for your help confirming the fix.

adammada commented 10 years ago

I have another related bug. When i was using .15 core i hoped that in .16 it will be fixed, but it isnt. So i will describe it.

When you have pseudostreaming + bitrate selection changing bitrate often makes "seek cursor" position jump some. It has to jump to nearest keyframe, but its not that. It sometimes jumps to the end of buffered area, then jumps back. Anyway its all good if you are not too close to the end. But in my test 3 -minute movie with keframes evert 5 seconds, sometetimes when i change bitrate after 120 seconds it jumps so much forward that "play again" is displayed. But then it jumps back as always and continues to play with "play again" displayed.

danrossi commented 10 years ago

Its like seeking with pseudo streaming so whatever is in the keyframes metadata ? Has nothing to do with bitrate switching. What if you try to seek to that same time normally ?

adammada commented 10 years ago

Its like seeking with pseudo streaming so whatever is in the keyframes metadata ? Has nothing to do with bitrate switching. What if you try to seek to that same time normally ?

No. I can seek how much i want within one bitrate file and pseudostreaming works just fine.

But when i switch bitrate SOMETIMES "seek cursor" jumps FAR forward and then goes back. (and it can be far enough to show "Play again" )

Maybe its because i'm swithcing bitrates when user goes to and back from fullscreen. Just look here:

http://flowplayer.blacktrash.org/test/brselect-pseudo-3215.html

and after jumping forward turn on-off fullscreen. You can see that moment after switching control bar shows that video is buffered from start to current position. So there is something going on with controllbar when changing to/from fullscreen.

And you can see mine setup here:

http://www.sportowefakty.pl/koszykowka/381745/nba-the-best-of-danilo-gallinari-wideo - EDIT: don't look server is broken now...

danrossi commented 10 years ago

^ is this using the file i just sent or else we're not on the same page. and a more basic example without ads and stuff. im assuming you mean it goes back to zero when changing to the new file. Thats because it has to completely change to the start of a new file and seek back to the current position.

adammada commented 10 years ago

I will back to it later with proper demo page and probably some screencapture showing what i mean.

danrossi commented 10 years ago

please let me know the resolution for this.

danrossi commented 10 years ago

OK so no dynamic switching on pseudo streaming this is only for Rtmp and HDS and HLS. I'll have a look again at manual switching with pseudo streaming. It looks like the time returned has to be supressed at this moment.

danrossi commented 10 years ago

I don't see a problem when switching streams, the time and scrubber doesn't change. Closing for now.