RenderHeads / UnityPlugin-AVProLiveCamera

AVPro Live Camera is a Unity plugin for webcams, TV cards and capture cards

Home Page:https://renderheads.com/products/avpro-live-camera/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game Performance cut 30% when "Live Preview" not in focus

clantogw opened this issue · comments

Describe the bug
In my game, in Play Mode, Im getting 85fps in the Game Window. That is, if the "Live Preview" button is ticked and in focus on the live Live Camera script in the Inspector. If I click another object, or de-select the Live Preview checkbox, the fps goes to 55.
My capture is a 30fps video. So initially I suspected the game is actually running at 55fps, and when the Live Preview is enabled, there is a bug that adds that video to the fps Stats, because the difference amounts to exactly 30 frames. However I can see in GPU-Z that my graphics card has a reduced load when Live Preview is enabled and in focus, and the second its not in focus the GPU load goes to 100%, corresponding with a drop in frame rate. My game is never intended to be built, and for now the workaround is to leave the Live Camera preview in focus. I am using two captures, one OBS-Cam, and one Decklink (Intensity Pro). Most curiously, when both instances of AV Pro Live Camera are completely disabled, the fps is still the low 55fps.

Your Setup (please complete the following information):

  • Unity version: 2019.3.4f1
  • AVPro Live Camera version: latest
  • Operating system version: win10
  • Hardware/webcam model: Decklink Intensity Pro. RTX 3080, AMD 3700X
  • Video mode (resolution, frame-rate, etc): 4k, 30fps. times 2.

This seems to be vsync related. Please check your vsync settings in the editor (in the Game View dropdown menu). Yes when the preview is in focus, the editor updates itself more often which can (in some version of Unity) show an increased frame rate in Unity. I think this is fixed in later versions of Unity. As for the performance, it sounds like you may be GPU limited in your application.