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

No audio through Unity using Media Player on Android. #1499

Closed JuanObiJuan closed 1 year ago

JuanObiJuan commented 1 year ago

Describe the issue

My situation is: I need to use Media Player API (Exo player permofms much worst than Media Player)

On the editor everything looks and sound right. But on the builds:

When I change on the Android Platform specific to "Exo Player" and put the right settings on the plugin and the hierarchy, audio works as expected (throug Unity and positional Audio works good).

But the the exact same settings but changing to "Media Player", on the build app, the audio output goes to the system, so no spatial audio or audio or posibility to route the audio to the mixer.

Since I understand that "Media Player" uses Unity native player API, and since Unity native video player is suporting audio through an audio source, I'm not sure if this is a bug or is simply not suported on AVPro.

AVPro Video: v2.7.3 (plugin v2.7.0f1-ultra) Target Platform: Android Unity: v2020.3.45f1 WindowsEditor OS: Desktop - MS-7B45 (Micro-Star International Co., Ltd.) - Windows 10 (10.0.19042) 64bit - English CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz - 12 threads - 16326KB GPU: NVIDIA GeForce GTX 1080 Ti - NVIDIA - Direct3D 11.0 [level 11.1] - 11127KB - 16384

Chris-RH commented 1 year ago

Spatial audio only works through Exoplayer. https://www.renderheads.com/content/docs/AVProVideo/articles/feature-360audio.html

Normal audio does work using Mediaplayer API set to Unity audio.

JuanObiJuan commented 1 year ago

Sorry, maybe i was not explaining good enough.

Im not using 360 audio or ambisonic, the videos Im playing are standar stereo.

I just want the feature that comes natively in Unity. Any audio source can be (faking it) be spatialized in 3D space playing with the pan and volume acording to 3D space.

On my Android builds Its working when Im using Exo player (playing stereo audio through the unity audio source) but not doing it when I use "Media Player". The audio is behaving like through the system and not though the audio source.

Worth to mention that Im targeting Oculus Quest.

JuanObiJuan commented 1 year ago

Any update on this?

adrianmeyerart commented 1 year ago

I have the same problem. When using "Exo Player" I can route the embedded audio in the video, to Unity to spatialize it as a 3D Sound Source (not ambisonics). Here it works both in the Editor as well as on the Android build (on Meta Quest2). If I use "Media Player" this still works in the Editor but not on the Android build. Here the audio just get's played back as a mono source, not being routed through the Unity 3D Audio Source.

I have to use "Media Player" and not Exo, because Exo's performance on Android is horrible. Hires videos crash that play perfectly smooth with "Media Player".

Would be very important for me that this gets fixed. Thanks

Chris-RH commented 1 year ago

Can you show me what component settings you are using please?

JuanObiJuan commented 1 year ago

This is the settings for the player

image

This is my Audio source

image

This is the audio output

image

As I mentioned before, everything it works as expected with exoplayer (with positional audio from the stereo tracks from the video). It works also in the apks running on the oculus quest.

With the exact same settings, just changing exo player to "Media Player" (wich is the player I want to use), in the editor looks like its fine but in the builds the behaviour of the audio is like "System direct" with no spatial audio and the audio doesnt run through the unity audio mixer.

stale[bot] commented 1 year 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.

Chris-RH commented 1 year ago

Sorry about the delay. I have double checked and can confirm the Unity audio output is exoplayer only, not android mediaplayer.