RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
226 stars 28 forks source link

ExtractFrame is returning null, events fired are in a wrong order (Android 10/11) #592

Closed cyliax closed 3 years ago

cyliax commented 3 years ago

Describe the bug I try to figure out the why ExtractFrame (tried Async as well) is returning null. I tried different ways to get the texture from a specific time and everything works well in a Windows 10 Unity Editor. But when I log the events fired on an Android device, it looks different and it is not working. I have no idea why there is no MetaDataReady and seeking started before video started. What would be the optimal order of events to wait for to get a thumbnail from a specific time? I'm confused.

Your Setup (please complete the following information):

To Reproduce

  1. Open media from an AbsolutePathOrURL with autoplay (or without)
  2. Wait for Started event to seek to position
  3. Wait for FinishedSeeking to extract frame (sync or async)
  4. Texure returned is null

Logs Log on a Windows PC Unity Editor:

StartedBuffering
MetaDataReady
ResolutionChanged
FinishedBuffering
Started
FirstFrameReady
StartedSeeking
FinishedSeeking
frameTexture2D  (UnityEngine.Texture2D)

Log on a Android device (Google Pixel 3a, same script):

StartedSeeking
StartedBuffering
Started
FinishedSeeking
frameTexture2D null

Screenshots If applicable, add screenshots to help explain your problem.

Videos If applicable, add a copy of your video or the URL

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us unitysupport@renderheads.com

Ste-RH commented 3 years ago

I am looking to reproduce this but am interested in how you are getting the FinishedSeeking event fired on Android. I was made aware this morning that there is a bug around this event firing, and indeed I am not seeing it fire here in my testing. I am using the ExoPlayer API path. Can you confirm you are also using ExoPlayer? Would it be possible to send me your logcat output and your test c# script? (so I am looking at the same event sequence as you are). You can email it over to unitysupport@renderheads.com if you wish to keep it private.

Ste-RH commented 3 years ago

The FinishedSeeking issue has been added: #594

It was also found there was an issue with supporting these events when using the MediaPlayer API path: #595

AndrewRH commented 3 years ago

@cyliax do let us know if 2.0.3 (released now) solves this issue. Thanks,