UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

FirstFrameReady is called only sometimes after OpenMedia

Open Kalumo opened this issue 1 year ago • 3 comments

Problem description:

For our project we require seemless transition between videos.

To avoid black frames we have a MediaPlayer running OpenMeida() and wait until the event FirstFrameReady is called. Then we make the switch. We now encountered the issue that FirstFrameReady Event is only sometimes not called, thus we wait forever.

Waiting for ReadyToPlay is not an option, because this can cause blackframes.

Is this a bug? Can the loading of the first frame be forced somehow?

Version 3.0.10

Device (which devices are you having the issue with - model, OS version number):

Windows 10

Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):

1 video, 1070x400, NotchLC, 60 fps

System Information:

AVPro Video: v3.0.10 (plugin v3.0.10f1-ultra) Target Platform: Standalone Unity: v2022.3.9f1 WindowsEditor OS: Desktop - HP Z4 G4 Workstation (HP) - Windows 10 (10.0.19045) 64bit - German CPU: Intel(R) Xeon(R) W-2225 CPU @ 4.10GHz - 8 threads - 130799KB GPU: NVIDIA RTX A6000 - NVIDIA - Direct3D 11.0 [level 11.1] - 48571KB - 16384

Kalumo avatar Oct 09 '24 15:10 Kalumo

Hi @Kalumo,

Thanks for reporting this.

We're not aware of any bugs with 'FirstFrameReady' (it's something we've used a lot recently, albeit not with NotchLC playback) and it's actually reliant on texture frames being produced so we'd expect the event to fire if you're seeing corresponding output on screen - if you remove the 'FirstFrameReady' check is the output still rendering? (Maybe after a few off/black frames of course)

If possible, do you have a test scene you could send to us? (Via [email protected] - please don't post here)

Cheers,

RichRH avatar Oct 10 '24 09:10 RichRH

Any update @Kalumo ?

Chris-RH avatar Oct 18 '24 11:10 Chris-RH

Seeing the same here with AVPro 3.0.11. On an Android build, Event Ready to Play is invoked, and First Frame Ready used to be invoked as well even if the video was not set to autoplay, but this doesn't seem to be happening anymore.

RuudvanReenen avatar Oct 20 '24 16:10 RuudvanReenen

Seeing the same here with AVPro 3.0.11. On an Android build, Event Ready to Play is invoked, and First Frame Ready used to be invoked as well even if the video was not set to autoplay, but this doesn't seem to be happening anymore.

Please report this as a separate issue @RuudvanReenen. It is a completely different code path and so will not be linked.

Ste-RH avatar Oct 22 '24 14:10 Ste-RH

@RichRH, there is no corresponding ouput on the screen for the frames where FirstFrameReady is not called. Only after calling Play() at some point the Event will fire. Before that, we only observe black frames.

Unfortunately, I am not able to share my scene.

Kalumo avatar Oct 23 '24 12:10 Kalumo

We haven't been able to reproduce this in the latest version of AVPro Video 3.1 in D3D11, but can in D3D12. Have you tried upgrading to the latest version and retesting?

The Notch video uses a (pretty common) 10-bit (DXGI_FORMAT_R10G10B10A2_UNORM) native format that Unity then wraps.. but it's never (and still doesn't seem to!) have a matching format at its level so we've always had to give it a random format that seemed to work (mainly for D3D12). Seems Unity have now broken that but still not provided a matching format.

Seeming as it's actually more of a Unity issue than us, as a workaround in D3D12 I think Notch videos encoded with alpha should work as it uses a texture format that is supported by Unity.. but alas using double the bandwidth of the current format!

Chris-RH avatar Oct 23 '24 13:10 Chris-RH