Closed pmb1701 closed 3 years ago
From the log:
[AVProVideo] Initialising AVPro Video v2.0.1 (native plugin v2.0.0f1-core) on Adreno (TM) 540/Vulkan 1.0.0 [512.513.0] (MT False) on Android
@pmb1701 I think you have your Graphics API set to Vulkan (it might be set to Auto), not OpenGLES3 or OpenGLES2. Can you check this please? We do not currently support Vulkan.
Our application is set to OpenGLES3, but I did indeed forget to change it from Vulkan for the test project this log is from. However, changing it has no effect on the outcome, the demo scene still crashes with the same fatal exception.
Oki, I will look deeper :)
Can I get a log from the OpenGLES3 run please Just in case there is something different.
Of course, here it is: https://clients.glue.work/s/Fbbn8RKNxmGzeHC
Log reports:
FATAL EXCEPTION: Loader:ProgressiveMediaPeriod Process: com.DefaultCompany.AVProTest2, PID: 15665 java.lang.Error: FATAL EXCEPTION [Loader:ProgressiveMediaPeriod] Unity version : 2020.2.1f1 Device model : Oculus Quest Device fingerprint: oculus/vr_monterey/monterey:7.1.1/NGI77B/1201830.9360.0:user/release-keys Build Type : Release Scripting Backend : Mono ABI : armeabi-v7a Strip Engine Code : false
Caused by: java.lang.AbstractMethodError: abstract method "void com.google.android.exoplr2avp.extractor.TrackOutput.sampleData(com.google.android.exoplr2avp.util.ParsableByteArray, int)" at com.google.android.exoplr2avp.extractor.mp4.Mp4Extractor.readSample(Mp4Extractor.java:536) at com.google.android.exoplr2avp.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:200) at com.google.android.exoplr2avp.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127) at com.google.android.exoplr2avp.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1046) at com.google.android.exoplr2avp.upstream.Loader$LoadTask.run(Loader.java:415) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761)
I have ran the Demo_MediaPlayer scene here with the Cones 2K HEVC video on a Quest1 in Unity 2018.4.15f1 and everything is as it should be. Will try Unity 2020.2.x now
Have reproduced here in Unity 2020.2.1f1. Didn't have to use a Quest to reproduce.
It appears the issue is the same as this.
We do have...
android.enableDexingArtifactTransform=false
...set in the Android plugin build environment, but it appears this needs to be set when building with Unity 2020.2.x. This is done by exporting the project out of Unity, opening in android Studio, adding that property to the 'gradle.properties' file, building and deploying. This is far from ideal. I will continue to see if I can find a work-around without having to export the project.
And here is the solution to avoid exporting the project each time you want to build/run...
Go to the 'Player Settings', 'Publishing Settings', 'Build' and tick 'Custom Gradle Properties Template' Edit the file shown in the path (\Assets\Plugins\Android\gradleTemplate.properties) and add the line:
android.enableDexingArtifactTransform=false
Save the file and build/run your project out of Unity.
If you could try this fix and let me know how it works out for you @pmb1701 I would very much appreciate it
I added that custom gradle property in our application project, and I can confirm that does indeed solve the crashing issue - unfortunately, only to reveal another issue, which is that Info.GetVideoWidth() and Info.GetVideoHeight() return zero for the dimensions of all videos in the Android build, which makes useless my own aspect ratio preservation solution that I had to implement in order to use the Apply To Mesh component. In the Editor, as well as Mac and Windows builds those methods seem to return correct dimensions as the aspect ratios get correctly adjusted. I will create a new issue for that.
That sounds very strange indeed! Looking forward to getting some details :)
Will close this issue now.
As a matter of fact I was able to fix it by getting the dimensions and calculating the aspect ratio upon a different MediaPlayer event. In Editor as well as Windows and Mac builds the dimensions seem to be correctly reported when the Started event fires, but in the Android build I had to react in FirstFrameReady instead, which seems like a more logical place anyway so I'll refrain from creating another issue. :) Thank you for the fix for the crash issue!
Ahh, oki...this is interesting!
You are seeing this because the Started event fires when the plugin says 'IsPlaying' is true. The width/height returned back from the c# AndroidMediaPlayer are actually local class members that are set when there is a texture to return. The log time between these is 13ms...so the next frame in essence. I might look at bringing this into line with other platforms for consistency.
Thanks for reporting it!
Describe the bug AVPro Video crashes on Quest 1 and 2 when loading a video. This was observed first in our application and then found to happen also with the AVPro Video sample scenes.
Your Setup (please complete the following information):
To Reproduce
Logs https://clients.glue.work/s/NkS23aXzx6CTH2n