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

Black screen with audio when playing video on Android device. #492

Closed innat3 closed 3 years ago

innat3 commented 3 years ago

Setup:

Bug Description:

I have an Android app that downloads 360º videos (using UnityWebRequest.Get) and plays them (using AVPro's MediaPlayer and Sphere360 mesh). The videos are downloaded into the persistentDataPath.

I have two tablets:

On a side note, If I load the "360SphereVideo" sample scene on the device, the video is displayed correctly. And if I grab the "SampleSphere.mp4" demo video and rename and replace it with one of my downloaded videos, my app displays it correctly as well.

So I'm actually confused, is this a plugin related issue or a permission related issue?

Ste-RH commented 3 years ago

In the working demo scene...are you loading the video from the exact same location as you are downloading to in the example that does not work?

Are both tablets running the exact same OS version?

Are you running with Fast OES mode at all?

innat3 commented 3 years ago

@RenderHeadsSte 1- In the working demo scene I am loading it from the StreamingAssets path. In my app however I am loading them using the MediaPlayer.FileLocation.AbsolutePathOrURL followed by persistentDataPath + FileName.mp4. As I mentioned, if I replace one of my downloaded videos with the "SampleSphere.mp4" video using the File Manager, the video is displayed correctly.

2- Both tablets are running Android version 10.

3- As fas as I know no, both tablets output this in the debug [AVProVideo] Opening /storage/emulated/0/Android/data/apk.package.name/files/Video.mp4 (offset 0) with API MediaPlayer [AVProVideo] Using playback path: MediaPlayer NonOES (4096x2048@30.00)

Ste-RH commented 3 years ago

So our sample video works fine, but your video does not?

Would it be possible to send the problem video to our support email? unitysupport@renderheads.com

innat3 commented 3 years ago

@RenderHeadsSte Exactly, but it's not just a single video, I have several and none of them work on the Samsung Tab A7 (video reproduces with audio but screen remains black), but they do for the Samsung Tab A (this might be related to the fact that the A7 is arm64-v8a while the other one is armeabi-v7a).

I even tested uploading your sample video to my server and downloading it using my app and I can watch it just fine, so I can't tell what the problem is. I've sent a sample video to the email you provided.

Ste-RH commented 3 years ago

@innat3 my hunch on this issue is that the different GPUs are the issue here.

The Tab A has an Exynos 7904 with a Mali-G71 MP2. Specs suggest it can handle '4k @30 fps'.

The Tab A7 has a Snapdragon 662 with a Adreno 610 GPU. I couldn't find any consistent specification for the max decode bandwidth other than '4k' from some sources, and only 1080p in others(!). Your video at 4096x2084 @25fps and 20MBit might be just too much for it.

Would you be able to re-encode your video down to the standard 4k resolution of 3840x2160 @25fps and maybe a lower bitrate...?

innat3 commented 3 years ago

@RenderHeadsSte

I've done some testing, I tried reducing the bitrate several times, down to 5MBit, but the issue persisted. I also tried reducing the resolution to 2048x1024 but that didn't work either, and finally I set it to 3840x2160 (the resulting file was only 80MB, down from 700~) but the screen remains black while the audio plays.

I wish I had another arm64-v8a device to test if this is a specific hardware/model related issue Any thoughts?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Ste-RH commented 3 years ago

Sorry @innat3, this one appears to have fallen off the radar somewhat. I am certain it is the GPU that cannot handle the resolution. Did you try re-encoding down to 1920 x 1080 @ 25fps?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue has been automatically closed because it has not had recent activity. If you wish to continue this issue, then please create a new issue as we do not monitor closed issues.