Search Unity

Video Recorder - Extreme lag in Game View

Discussion in 'Audio & Video' started by calebcarithers, Aug 5, 2019.

  1. calebcarithers

    calebcarithers

    Joined:
    Jan 9, 2019
    Posts:
    2
    Successfully used the Recorder a few weeks ago, with a playable frame rate in the Game View. Currently when using the recorder to capture an MP4 movie, the game view lags an excruciating amount. Below I have attached my recording settings, as well as a setup of the scene I am trying to record and included script. I am trying to record a character playing through a designed map, and am having the same problems recording in that scene as I am in this one (this scene is a dumbed down version of my ultimate goal).

    Running 2019.2.0f1 with Unity Recorder 2.0.2

    LyricRotation.cs

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class LyricRotation : MonoBehaviour
    6. {
    7.     // Attached to lyric parent object. Rotates the 3d lyric in play area.
    8.     // Rotates back and forth.
    9.  
    10.     public float Speed = 2.0f;
    11.     public float secondsToRotate = 1f;
    12.     float rotateTimer = 0.0f;
    13.  
    14.     // Start is called before the first frame update
    15.     void Start()
    16.     {
    17.      
    18.     }
    19.  
    20.     // Update is called once per frame
    21.     void Update()
    22.     {
    23.         rotateTimer += Time.deltaTime;
    24.         //Debug.Log(rotateTimer%2);
    25.         if (rotateTimer%2<1)
    26.         {
    27.             transform.Rotate(0f, Speed, 0f, Space.World);
    28.         }
    29.         else
    30.         {
    31.             transform.Rotate(0f, -Speed, 0f, Space.World);
    32.         }
    33.     }
    34. }
    Screen Shot 2019-08-05 at 4.35.47 PM.png Screen Shot 2019-08-05 at 4.41.51 PM.png
     
    deus0 likes this.
  2. calebcarithers

    calebcarithers

    Joined:
    Jan 9, 2019
    Posts:
    2
    I have found plugging into an external monitor with an HDMI resolves this issue. Without external monitor plugged in while recording, Game View runs ~5fps, while with a monitor plugged in, it runs ~60fps
     
  3. Thomukas1

    Thomukas1

    Joined:
    Sep 29, 2014
    Posts:
    31
    Hi, please tell me this is not the best that the recorder can do? is there anything i can do to make it lag less?
    Even when i tried recording at 240p with low quality, it looks the same in profiler..

    Screenshot_1.png
     
  4. Enderlook

    Enderlook

    Joined:
    Dec 4, 2018
    Posts:
    51
    I'm having the same issue. Is there any workaround to solve the lag?
     
  5. XochiInteractive

    XochiInteractive

    Joined:
    May 21, 2018
    Posts:
    19
    Same issue here, any recommendations? Without the Recorder running my game runs between 60-100 FPS but goes all the way to 15 FPS when Recorder is set to start recording. I watched the Profiler and noticed in "Other" it spikes and the main CPU usage is coming from PlayerLoop, EarlyUpdate.UpdateAsyncReadbackManager, VideoMediaEncoder.AddVideoFrame, & VP8VideoMedia.VpxEncodeFrame. These things are causing my FPS to drop to where the cutscene goes super slow and the recording records it in that slow motion, I would speed up the video but it's speeds are inconsistent and bounce between slow and normal speed occasionally.
     
  6. Bananozuar

    Bananozuar

    Joined:
    Oct 15, 2016
    Posts:
    6
    I have the same problem. Normally my scene runs at 500 fps when not capped. With recorder its creazy 6fps.
     
    deus0 likes this.
  7. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
  8. deus0

    deus0

    Joined:
    May 12, 2015
    Posts:
    256
    Same issues with Unity 2021.2.12f1. I hope it can be fixed one day. I may just record images with ScreenCapture and compile my own videos instead.
     
  9. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Any news / workaround for this? This is super annoying. In fact unusable.
     
  10. strongBearCeo

    strongBearCeo

    Joined:
    May 2, 2016
    Posts:
    7
    Same issue for me. I'm trying to record 360 video but as soon as I hit record, it drops from 60FPS to < 20FPS