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

Noise Occurs When Playing 48000Hz Video After Playing 44100Hz Video in ExoPlayer #1958

Closed NK-Studio closed 3 days ago

NK-Studio commented 1 month ago

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Describe the issue When building for Android and using ExoPlayer with audio output in Unity's format, an issue occurs where playing a video with 48000Hz audio after initially playing a video with 44100Hz audio results in noise and static in the audio of the 48000Hz video.

Your Setup (please complete the following information):

To Reproduce

  1. Change the audio mode to Unity on the Android platform of the Media Player.
  2. First, play the mp4 file with 44100Hz audio using mediaPlayer.Open(absoluteOrURL, path).
  3. Next, play the video with 48000Hz audio.
  4. Noise occurs in the video with 48000Hz audio!

Logs If applicable, add error logs to help explain your problem.

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

Chris-RH commented 1 month ago

Does this occur in Vulkan, OpenGLES or both? Does this also occur in Android Mediaplayer API, as well we Exoplayer? Are you able to provide a full, unfiltered logcat in txt form

Thank you for the test project sent via email. Our dev team is currently on annual leave until the end of August.

NK-Studio commented 1 month ago

I am currently proceeding with the project by disabling the Auto Graphic option and only checking OpenGLES3, and a bug has occurred in this situation.

This issue only occurs with EXO Player.

Additionally, I mistakenly set the Android platform video playback method of the Media Player component in the test project I sent you to Media Player. If you switch it to EXO Player, you will be able to identify the issue.

The sound quality feels distorted, as if the volume suddenly peaks or noise is applied to the sound.

Currently, due to the urgency of the release, I am resolving the issue by calling mediaplayer.ForceDispose() to forcefully release and allocate the Media Player each time a new video needs to be played.

I am not sure about the potential risks of this method, but I believe it is the best solution I can implement at the moment.

It seems there will be no major issues until I return from vacation, and I hope this will be resolved later.

Chris-RH commented 1 month ago

OK, thank you for the additional information

NK-Studio commented 2 weeks ago

AVPro Noize.zip

I forgot to send the log file earlier, so I'm sending it now. The log extracts the action of loading a video with 44100 Hz first, followed by loading a video with 48000 Hz.

Ste-RH commented 2 weeks ago

I have reproduced this now and looking into a fix.

Ste-RH commented 2 weeks ago

A fix for this will be included in the next release (v3.0.10).

Ste-RH commented 1 week ago

AVPro Video v3.0.10 has now been released. Do let us know if this fixes the issue for you.