flowplayer / flash

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

rtmp + hw accel + instream clips lose video, or aspect ratio #44

Closed phloxic closed 11 years ago

phloxic commented 12 years ago

http://flowplayer.blacktrash.org/test/instream-accel.html

No video for the instream clip. After invisible instream clip, parent clip is (sometimes) distorted and has the aspect ratio of the instream clip.

Another variant: http://flash.flowplayer.org/forum/7/104184#post-104217

The flowplayer branding is constantly visible.

I still get the bleached colors, but have given up on that.

ViliusS commented 12 years ago

For me the instream clip plays fine, but I can confirm the bleached colors thing.

phloxic commented 12 years ago

Yeah. The canvas shines through, so to speak. Opened a new issue for an old problem: #45

phloxic commented 12 years ago

I guess the instream problem happens on my machine because my Flash is too old - 10.3. But if that's not supported, a version which does not exhibit the behavior should be required for acceleration.

ViliusS commented 12 years ago

From our own experience I can confirm that version 10.3 is the one which is "buggy" using HW acceleration. Checking at least for 11.2 in ActionScript code and then enabling/disabling acceleration automatically would be great.

danrossi commented 12 years ago

I'm seeing all kinds of crazy stuff here for sure, this is with the free player though. We did test all canvas options on my end and i saw nothing like this before.

phloxic commented 12 years ago

Yes, I colored the canvas for testing and removed the background gradient :-( Same for commercial w/o background gradient: http://flowplayer.dev/test/commercial-accel.html

danrossi commented 12 years ago

Perhaps indeed the zip i sent in the other ticket will fix your problems, looks good here https://dl.dropbox.com/u/3394987/svdemo3.png

ViliusS commented 12 years ago

This bug still present when testing with Flowplayer version from ticket #42

danrossi commented 12 years ago

Sorry guys this is nuts, ok the deal with the white stuff, is the stage video mask layer needs to be positioned on top, so the indexing was still not right. I've changed it and looks good in my tests. The free logo problem above is because its still in the dev commits it seems. Changing the index, makes it sit on top so the gradient white doesn't show as it was obviously on top. I'm not sure why I never managed to see this before on the commercial player. This video is dark though so it helped. The problem with the instream im trying to work out its showing two stage video objects somehow if i keep it in fullscreen, its visible so strange. The video however appears.

danrossi commented 12 years ago

my fixes to stop stage video events because of a problem repositioning after each seek once it's setup is causing this. It needs to clear stuff then get added again for instream clips. if I remove all those changes it will work but then it might cause those seek problems again.

ViliusS commented 12 years ago

Are you sure that seeking fixes brought up this issue? I'm not 100% sure, but as far as I remember this happened in earlier versions too.

danrossi commented 12 years ago

I dont know what you are referring too but yes it is. in fact if I take them out because onbegin isn't dispatching constantly and some changes to the adding of video to the screen, i think the seek flickering problem may be fixed already. Id rather keep these fixes in though.

https://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.15.zip

Try this, it will clear the stage video when changing to the instream so it will resize correctly also. Those fixes unbind the listeners it doesn't get set back up between clips. Perhaps I can detect a clip change then setup the listener again.

danrossi commented 12 years ago

I might have to undo all my previous changes just to get this working sadly.

ViliusS commented 12 years ago

Still doesn't work. Steps to reproduce:

  1. Wait for the pre-roll to finish.
  2. Seek past 15 seconds to enforce mid-roll.
  3. After mid-roll finishes seek back to 13 seconds.
  4. Wait for the mid-roll to finish second time. StageVideo mask remains on screen.

By the way, when playing second time mid-roll starts from the last frame of the video. Just try to remember last frame in step 2, and watch it at step 4.

danrossi commented 12 years ago

This one is going to take a while to figure out the other problems are done. The stagevideo is still repositioning on seeking after taking those restrictions out. If i run dimension checks so it doesn't resize and position each time the display gets messed up as you likely are seeing already.

ViliusS commented 12 years ago

I'm not the expert in AS3 and Flash but looking at the code can't we just destroy instream clip object with the mask after it is played?

danrossi commented 12 years ago

I have a couple of solutions but it requires yet more code to turn off / on these stage video events at certain times so it's not left on all the time so to speak as this is what causes problems repositioning all the time obviouslly. Unfortunately the other logical solution is to check if the dimensions have changed and then resize and position however this doesn't seem to be working sadly as in, the instream video will stay appeared while moving back to the original clip as per your initial report. If i can find a more direct way and undo my original changes then we should go with that I suppose.

danrossi commented 12 years ago

https://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.15.zip please try this solution but i may change it.

ViliusS commented 12 years ago

Still no change. The behaviour is the same as before.

Have you zipped it right this time? :)

danrossi commented 12 years ago

Hi thanks for persisting, after alot of mucking around I come up with the other solution which works, it will prevent repositioning and resizing of the properties haven't changed, though it's doing inidividual property checking on video resizing, fullscreen, seeking, as the events are being sent during these phases still.

https://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.15-solution1.zip

im still trying to get the other solution to work it was working and now not. the issue is turning off these events cause this display issue so they have to be turned back on at certain times.

danrossi commented 12 years ago

https://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.15-solution2.zip solution 2, the events actually need to be dispatched twice to pickup width and height changes, ive kept the changes from 1 all this does is add / remove the events when required and hopefully this functions better. It needs to pickup the transition between an instream clip and when returning to the main clip as the main clip simply resumes.

ViliusS commented 12 years ago

I have tried both solutions. Both work a lot better now, I see no bleached colors, control bar issues are also gone.

mid-rolls are OK if I play them consequently, but they still don't work if I try to skip them by seeking and OVA enforces mid-roll playout.

Latest example with solution2 code: http://post.lnk.lt/flow/dev/mid/test.html Do you have access to it? Can you reproduce it?

This works: 1) Open my example, wait for pre-roll to finish. 2) When main clip starts playing wait for 15 seconds mark for the mid-roll to start. 3) When mid-roll finishes and main clip starts playing again, seek control bar back to 10 seconds. 4) Wait for mid-roll to start and finish second time. You can repeat this as much as you can and it works!

And now this doesn't work: 1) Open my example, wait for pre-roll to finish. 2) When main clip starts playing seek to 1 minute mark. This enforces mid-roll at 15th second to start. 3) When mid-roll finishes and main clip starts playing again, seek control bar back to 10 seconds. 4) Wait for mid-roll to start and finish second time. Now you can see that audio from main event resumes playing, but video is freezed. 5) Click Full-Screen and you will see main video underneath mid-roll mask.

Can you reproduce all of the above? If not, I can send you OVA swf for testing purposes.

danrossi commented 12 years ago

Im not testing with ova for now just instream clips as above so please try that instead, you can't seek ads with ova if you can thats a bug.

ViliusS commented 12 years ago

I mean that I seek main video, not the ads.

http://post.lnk.lt/flow/dev/mid/test2.html the instream test with solution2 code. Sadly I still see the same bleached colors as in original comment #1.

danrossi commented 12 years ago

ova is the next step as its too complicated to debug. Try and use christians example above for a basic instream setup thats what ive been using if possible.

ViliusS commented 12 years ago

I am using Christian's example. Please see the HTML code at my link.

danrossi commented 12 years ago

yep its still needs to update on certain circumstances ill have a look tommorow now.

danrossi commented 12 years ago

what about the first zip

ViliusS commented 12 years ago

Much better. See http://post.lnk.lt/flow/dev/solution1/test1.html which is using solution1 zip.

danrossi commented 12 years ago

ok let me see if there is performance differences between the two I might have to just go with solution 1 sadly. I dont see anything wrong with the indexing of the displays here.

danrossi commented 12 years ago

Sorry its taken a while this is , Im getting reports of 1.5% cpu usage with solution 2 so all good to go, Im disabling the stage video events for seeking to work around those issues but Ive also added checks to not reposition unless required.

danrossi commented 12 years ago

https://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.15.zip no display indexing issues here.

ViliusS commented 12 years ago

As mentioned in my last message, solution2 doesn't work at all. Solution1 works much better here.

Solution2 (http://post.lnk.lt/flow/dev/mid/test2.html latest code from your zip):

  1. Still contains bleached colors.
  2. StageVideo mask remains on screen after second mi-roll.

Solution1 (http://post.lnk.lt/flow/dev/solution1/test1.html the code from https://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.15-solution1.zip):

  1. Colors are OK.
  2. StageVideo mask still remains on screen after second mid-rool.
danrossi commented 12 years ago

Hi I dont see any display indexing issues with your first example it displays fine so I think we fixed the issues now.

ViliusS commented 12 years ago

Have you checked full screen? Is hw acceleration enabled in your Flash?

danrossi commented 12 years ago

https://dl.dropbox.com/u/3394987/flowplayer.commercial-3.2.15.zip it didnt re-generate properly again.

ViliusS commented 12 years ago

Yes thank you. This works very well without OVA. Even better than 3.2.14 and 3.2.15 releases. However this doesn't work in one particular case which I've mentioned in my original first comment when testing with OVA.

"mid-rolls are OK if I play them consequently, but they still don't work if I try to skip them by seeking and OVA enforces mid-roll playout.

Example with your latest code: http://post.lnk.lt/flow/dev/mid/test.html Do you have access to it?

This works: 1) Open my example, wait for pre-roll to finish. 2) When main clip starts playing wait for 15 seconds mark for the mid-roll to start. 3) When mid-roll finishes and main clip starts playing again, seek control bar back to 10 seconds. 4) Wait for mid-roll to start and finish second time. You can repeat this as much as you can and it works!

And now this doesn't work: 1) Open my example, wait for pre-roll to finish. 2) When main clip starts playing seek to 1 minute mark. This enforces mid-roll at 15th second to start. 3) When mid-roll finishes and main clip starts playing again, seek control bar back to 10 seconds. 4) Wait for mid-roll to start and finish second time. Now you can see that audio from main event resumes playing, but video is freezed. 5) Click Full-Screen and you will see main video underneath mid-roll mask.

Can you reproduce all of the above? If not, I can send you OVA swf for testing purposes."

danrossi commented 12 years ago

Hi it works with the basic instream examples , that sounds like an ova issue. I still dont see any ads come up as mentioned before.

ViliusS commented 12 years ago

I will try to get our Ad provider to fix the ad examples. In the meantime:

As mentioned in old bug report: http://code.google.com/p/flowplayer-core/issues/detail?id=608 this is not something that OVA can control at all. All OVA does is: _player.playInstream(clip) where "_player" is Flowplayer.

Flowplayer is responsible playback (starting, stopping and closing the instream clip). Clearly in this case, Flowplayer is not correctly closing down the instream clip.

I can contact Paul on this issue too. Maybe he can comment more. But basically above is what he said --^

danrossi commented 12 years ago

If it's working in the basic instream example then it is closing ;) It might take a considerable amount of time for us to debug this for them, I dont know what they are doing exactly.

ViliusS commented 12 years ago

OK. I have contacted Paul. Maybe he can describe the problem better.

danrossi commented 12 years ago

I'll try one more example but using that api method. I might have to build a plugin first to do it though :( I can't really test ova unless I can get a working ad doing the same configuration.

danrossi commented 12 years ago

This code which serves the same purpose works fine

function playinstream() { $f().play({ url: "mp4:ccc_trailer1", position: 15, duration: 20 }, true);

}

I think we're over the hard problems now, just need to figure out whats going on with ova.

ViliusS commented 12 years ago

I agree. I think the problem could be because OVA enforces mid-roll playback when you try to seek main video past the mid-roll point. And this trigger some kind of bug in Flowplayer.

danrossi commented 12 years ago

I'm going to push what I have so far if possible and make extra changes if needed.

ViliusS commented 12 years ago

The release from the current version would be great :)

danrossi commented 12 years ago

It's up, appreciate your help on the matter. It may take some time for all these commits to be merged and then a release made.

ViliusS commented 12 years ago

Dan, have Paul contacted you regarding OVA behaviour?

danrossi commented 12 years ago

No have you got your ad feed working yet for my region ? Im not in europe but australia ;) I can debug the plugin better that way.

ViliusS commented 12 years ago

Can you help me to debug the feed? My ad provider swears that everything should work out of the box.

Can you try accessing the clips directly? Here: http://lt.adocean.pl/files/oohefmenoi/xajkevmjdv/R16756.mp4 Do you see the clip downloading? Or do you see something like 404 Not Found error?

Also can you please ping to lt.adocean.pl and tell me the output?