RenderHeads / UnityPlugin-AVProVideo

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

[2.1.8] Unity Audio Output issue after upgrading from version 1.x #926

Closed michaelj909 closed 2 years ago

michaelj909 commented 3 years ago

Describe the issue: I'm having issues getting audio output in unity to work in my project after upgrading from AVPro Video v1.11.4.

I followed the steps in the documentation for upgrading from 1.x (deleting the old plugin and main folders, as well as sample videos, before importing the 2.1.8 package then resolving compilation errors). After importing 2.1.8 I loaded the 'Demo_MediaPlayer' scene and played it in order to ensure that package was working, with no modification to the demo scene other than making sure that the 'Audio Output' setting on the 'Media Player' component was set to 'Unity'. However, the audio for the sample video (RenderHeads-1080p30-H264.mp4) completely failed to play. The audio visualisation in the demo scene's remained a flat line, and the visualisation in the 'Audio Output' component never appeared (see attached image 1). No errors, or even warnings, occurred from any scripts.

I then created a new, blank unity project (in the same version of unity), imported 2.1.8, and loaded the same demo scene. In the fresh project the audio in unity worked without issue (see attached image 2).

One thing I have noticed when comparing the two is that the "Buffered" value on the 'Audio output' component remains steady in the fresh project (at around 800-900), while in my existing project the value steadily rises as the video plays (you can see it at over 10000 in image 1).

Both the project I'm working on and the fresh one I'm using the same version of Unity (2020.3.16f1), the same version of AVPro Video Core (2.1.8), the same demo scene, and the same demo file, with all settings with the scene the same, and yet I'm experiencing different audio behaviour between the two.

Are there any Unity settings in my existing project that could be causing this issue? Or, alternatively, could something in the upgrade from AVPro 1.11.4 to 2.1.8 be causing it? Updating from the old package is the only difference I can think of between my project (where audio in unity isn't working) and the fresh project (where it works fine).

Thanks in advance for any help with this! And thanks for the quality assets you've developed (I've also found the video capture and live camera assets incredibly useful)!

Your Setup (please complete the following information):

Logs N/A - No errors, warnings, or print statements occurred.

Screenshots Image 1 is from my existing unity project, using the 'Demo_MediaPlayer' scene (unmodified), where the audio isn't working. Image 2 is from a fresh unity project in the same version of unity, using the same scene, with the same settings, where the audio is working.

AVPro 1 AVPro 2

AndrewRH commented 3 years ago

Hi,

I'm not sure why the upgrade did that - i wasn't able to reproduce that effect here. The fact that 1) the buffered size increases and 2) that there are no green VU bars suggests the OnAudioFilterRead is not running.

You can check in AudioOutput.cs to make sure that method is present and compiling:

image

Otherwise, perhaps try importing the package again following the steps in the instructions?

Thanks,

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

kahnivore commented 2 years ago

Closing as we haven't heard back from the user and could not reproduce.