RenderHeads / UnityPlugin-AVProVideo

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

Video fails to open in Unity Editor on a Windows Server virtual machine #1484

Closed daltonbr closed 1 year ago

daltonbr commented 1 year ago

Describe the issue

Video fails to open in Unity Editor on a Windows virtual machine.

Your Setup:

Context information:

To Reproduce

It may be tricky to reproduce our environment as we have a custom Windows image, but we may get back to that if needed.

In short, playing a video inside that virtual machine would suffice.

Logs

[AVProVideo] Failed to open https://d1xdf48549vgyg.cloudfront.net/tasks/video/e6f46e47-f0da-4c06-b8f8-43f09c614f64.mp4
---
UnityEngine.Debug:LogError (object,UnityEngine.Object)
RenderHeads.Media.AVProVideo.MediaPlayer:InternalOpenMedia () (at C:/jenkins/workspace/Yousician_Tests_PR-17850/Packages/com.renderheads.avpro/Runtime/Scripts/Components/MediaPlayer.cs:611)
RenderHeads.Media.AVProVideo.MediaPlayer:OpenMedia (bool) (at C:/jenkins/workspace/Yousician_Tests_PR-17850/Packages/com.renderheads.avpro/Runtime/Scripts/Components/MediaPlayer.cs:509)
RenderHeads.Media.AVProVideo.MediaPlayer:OpenMedia (RenderHeads.Media.AVProVideo.MediaPathType,string,bool) (at C:/jenkins/workspace/Yousician_Tests_PR-17850/Packages/com.renderheads.avpro/Runtime/Scripts/Components/MediaPlayer.cs:488)
RenderHeads.Media.AVProVideo.MediaPlayer:OpenMedia (RenderHeads.Media.AVProVideo.MediaPath,bool) (at C:/jenkins/workspace/Yousician_Tests_PR-17850/Packages/com.renderheads.avpro/Runtime/Scripts/Components/MediaPlayer.cs:479)
Yousician.VideoPlayer.AVPro.MediaPlayerProxy:OpenMedia (RenderHeads.Media.AVProVideo.MediaPath,bool) (at Assets/VideoPlayer/AVPro/MediaPlayerProxy.cs:94)
Yousician.VideoPlayer.AVPro.AvProVideoPlayer/<>c__DisplayClass44_0:<Load>b__0 () (at Assets/VideoPlayer/AVPro/AvProVideoPlayer.cs:109)
UniRx.Operators.DeferObservable`1<bool>:SubscribeCore (System.IObserver`1<bool>,System.IDisposable) (at C:/jenkins/workspace/Yousician_Tests_PR-17850/submodules/UniRx/Assets/Plugins/UniRx/Scripts/Operators/Defer.cs:22)
UniRx.Operators.OperatorObservableBase`1<bool>:Subscribe (System.IObserver`1<bool>) (at C:/jenkins/workspace/Yousician_Tests_PR-17850/submodules/UniRx/Assets/Plugins/UniRx/Scripts/Operators/OperatorObservableBase.cs:34)

Screenshots

AvPro

NativeVideoPlayer

We are running this virtual audio device to emulate an audio input device - https://vb-audio.com/Cable/

Screenshot 2023-03-09 at 16 54 26

daltonbr commented 1 year ago

In the meantime, I'll make sure to reach you through the support email.

Ste-RH commented 1 year ago

Can you narrow down the issue a bit, maybe try removing audio from chain to see if it’s the virtual device that is causing the issue?

Are you using MediaFoundation? Have you tried WinRT and DirectShow?

Have you tried playing the video back served locally, rather than from cloudfront?

Ste-RH commented 1 year ago

We have had a joined up chat internally on this one and have some more thoughts.

It looks like there is no hardware decoder available in the instance. Can you confirm what the GPU is available to the instance?

If this is the case, you can try disabling the hardware decode option (find it under Platform - Windows - Media Foundation in the MediaPlayer component). Just untick the option.

daltonbr commented 1 year ago

Thanks for the swift response @Ste-RH!

Disabling Hardware decoding solves the issue! 🎖️

We were using MediaFoundation. For posterity, that machine doesn't seem to have a dedicated hardware GPU - it only shows a Microsoft Basic Display Adapter. Screenshot 2023-03-10 at 9 56 50

A huge thanks to the team and you, Ste!


As a follow-up, is it possible to have this information in the logs? Such as 'No hardware decoding found.'

Also, is it possible to have an automatic fallback solution where we try to decode the video through software if it fails on hardware? If feasible, this is a significant feature enhancement.

Chris-RH commented 1 year ago

We are looking at improving logging. I'm glad its working for you now :)