Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug Unity Recorder output has wrong frame order

Discussion in 'Audio & Video' started by Kihwan-Choi, Jul 21, 2022.

  1. Kihwan-Choi

    Kihwan-Choi

    Joined:
    Jul 28, 2021
    Posts:
    2
    Sometimes, My recording video has wrong frame order.

    I`m using below code.

    Can I fix this issue?

    Code (CSharp):
    1. var controllerSettings = ScriptableObject.CreateInstance<RecorderControllerSettings>();
    2.             _recorderController = new RecorderController(controllerSettings);
    3.  
    4.             var videoRecorderSettings = ScriptableObject.CreateInstance<MovieRecorderSettings>();
    5.             videoRecorderSettings.name = "Avatar Video Recorder";
    6.             videoRecorderSettings.Enabled = true;
    7.             videoRecorderSettings.VideoBitRateMode = videoParams.Quality;
    8.             videoRecorderSettings.OutputFormat = videoParams.Format.GetOutputFormat();
    9.             // videoRecorderSettings.CaptureAlpha = true;
    10.  
    11.             videoRecorderSettings.ImageInputSettings = new GameViewInputSettings
    12.             {
    13.                 OutputWidth = videoParams.Width,
    14.                 OutputHeight = videoParams.Height,
    15.             };
    16.  
    17.             videoRecorderSettings.AudioInputSettings.PreserveAudio = false;
    18.  
    19.             videoRecorderSettings.OutputFile =
    20.                 path.Replace("." + videoRecorderSettings.OutputFormat.GetSuffix(),
    21.                     ""); // Change this to change the output file name (no extension)
    22.  
    23.             controllerSettings.AddRecorderSettings(videoRecorderSettings);
    24.             controllerSettings.SetRecordModeToFrameInterval(0, clip.FrameCount );
    25.             controllerSettings.FrameRatePlayback = FrameRatePlayback.Constant;
    26.             controllerSettings.FrameRate = AvatarMpServerSettings.VideoFps;
    27.             controllerSettings.CapFrameRate = false;
    28.  
    29.             RecorderOptions.VerboseMode = false;
    30.             _recorderController.PrepareRecording();
    31.             _recorderController.StartRecording();
     
  2. Kihwan-Choi

    Kihwan-Choi

    Joined:
    Jul 28, 2021
    Posts:
    2
    bad example


    good example