Search Unity

Video Unity Recorder update

Discussion in 'Audio & Video' started by ans_unity, Dec 19, 2017.

  1. razo84

    razo84

    Joined:
    Jan 15, 2017
    Posts:
    21
    Hi there, anybody experiencing issue starting recording with Recorder 2.0.2 preview.2 on Unity 2019.3.0f6 ?
    When I hit Start Recording, Play Mode won't start and this exception is thrown instead.



    Also, changelog for Recorder mentions version 2.0.3, but I can't see it in Package Manager (yes, I have preview packages checked).

    Thanks for any clues!
     
  2. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hey @hanger102! Unfortunately this is a known limitation of the Recorder. We don't have an ETA at the moment for a fix but I'll bring it up with our team again.
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,143
    @cguertin Could you chime in on this? I'm about to start a project that will depend on this ...

     
  4. Thomukas1

    Thomukas1

    Joined:
    Sep 29, 2014
    Posts:
    20
    Hi, guys. I have a couple of questions, hopefully someone can help me out or direct me to where i could get help.
    First of all, is it true that unity recorder doesnt work in build? Is it going to be added later?
    Also, recording videos really hit my gpu. The vr camera view is stable, but everything in the scene lags, even when the scene is pretty much empty. Is the recorder not optimised or is it something on my end?
    Thanks
     
  5. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    520
    cursor1.gif
    I just wrote a simple cursor animation script to use with recorder.
    Swaps cursor textures during animation, but I can upload only up to 5 files in the message; while I used six frames in this.
     

    Attached Files:

  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,143
    Never mind. I just realized that I can simply put two cameras side by side (one rendering to the left area of the game view, one to the right). That works fine.

    ... except: Something causes the left camera to have a weird light-pumping effect, and the wind seems to have a much wilder effect on the vegetation than what I see on the right camera. I'm not perfectly sure when it started; I did do a 360 render for testing, also switched from the default (Forward) rendering path to deferred and back.

    At first I was almost certain something was going wrong with Auto Exposure - but I get the same weird effect when PostProcessing is completely disabled.
     
  7. Louis_Amerongen

    Louis_Amerongen

    Joined:
    Jul 21, 2017
    Posts:
    19
    Hi,

    I've got Unity 2019.3.0f6 and want to use the Unity Recorder to record an animation. I've downloaded and installed the recorder at the Package Manager. See image below:

    upload_2020-2-6_17-25-8.png

    When looking under Window - General however, no Recorder tab can be found (see image below). What am I doing wrong?

    upload_2020-2-6_17-28-57.png

    Thanks Louis
     
  8. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,143
    Click "Import into Project" on Recorder Editor Sample. That should make the menu entries appear. I wondered whether that was really needed or not just yesterday. You confirmed to me that it is indeed needed ;-)
     
  9. Louis_Amerongen

    Louis_Amerongen

    Joined:
    Jul 21, 2017
    Posts:
    19
    Thank you Jashan!
     
  10. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hey @Giaco80, we're really glad you are enjoying the Recorder! We don't currently have any built-in queuing system but I'll discuss with the team if it's something that we would want to consider in the future.

    In the meantime, it shouldn't be too complicated to make a script that loads your scenes one at the time to Record them. You can load an existing scene using the following:
    Code (CSharp):
    1. SceneManager.LoadScene("TestAov", LoadSceneMode.Single);
    And this is an example on how to create a new Recorder and start/stop it:

    Code (CSharp):
    1.     public void StartAndStopRecording_WithValidSettings_ShouldStartThenStopRecording()
    2.     {
    3.         var settings = ScriptableObject.CreateInstance<RecorderControllerSettings>();
    4.         var imageRecorder = ScriptableObject.CreateInstance<ImageRecorderSettings>();
    5.        
    6.         settings.AddRecorderSettings(imageRecorder);
    7.         var recorderController = new RecorderController(settings);
    8.        
    9.         Assert.IsTrue(recorderController.StartRecording());
    10.         Assert.IsTrue(recorderController.IsRecording());
    11.        
    12.         recorderController.StopRecording();
    13.         Assert.IsFalse(recorderController.IsRecording());
    14.        
    15.         Object.DestroyImmediate(imageRecorder);
    16.         Object.DestroyImmediate(settings);
    17.     }
    Let us know if you have any questions!
     
  11. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hey @jashan, apologies for the late answer! We don't currently support non-360 stereo recording but I'll discuss with our team if it's something we could consider implementing in a future version. Glad you found a workaround!

    Could you open a new thread regarding the visual differences between the left and right cameras (just to simplify the follow-up) and add the following information?
    1 - Which Unity version and Recorder package versions are you using?
    2 - Are you using HDRP?
    3 - Are you recording the left and right cameras at the same time (two Recorders) or one after the other?
    4 - Are the problems only appearing on the left camera (or sometimes the right instead)?

    You can add the "Recorder" tag on the new thread, thanks!
     
    Last edited: Feb 10, 2020
  12. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hi @Xarbrough! We don't currently support Recording of stepped frames but it's a great idea. I've passed it on as a suggestion to our team for possible development on future versions on the package.

    Thanks!
     
  13. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hey @razo84! The latest version of the Recorder package is now 2.1.0 (preview). Before digging to far I'd like to try and figure out why it's not available in your package manager. I ran a few tests on my end with the same Unity version as you (2019.3.0f6) and haven't been able to reproduce that behavior.

    To rule out a few possible issues, could you try the same thing from a new/empty project? Could you also send a screenshot of your package manager showing which versions of the Recorder are currently available to you?

    Thanks!
     
  14. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hey @Thomukas1, the Recorder package is indeed only available in Editor mode and we don't have currently have plans to add support for builds.

    When you mention that "everything in the scene lags", is that also the case for the images that get recorded (animations don't have the expected timing in the movie/image sequence) or only the Unity interface while it is recording?

    Thanks!
     
  15. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hey @Louis_Amerongen, that's a weird one. I ran a few tests on my end but couldn't replicate the problem with the same version of Unity and Recorder package as you.

    I'm glad @jashan suggestion worked but it shouldn't be needed generally. The Recorder menu is supposed to appear right after installing the package.

    1 - Do you also get the same issue in a fresh/empty project?
    2 - Do see any errors or warnings in the console after installing the Recorder package?
     
  16. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    544
    The release notes seem to be missing from the manual: https://docs.unity3d.com/Packages/com.unity.recorder@2.1/manual/index.html

    I'm happy to keep testing + re-testing the previews and reporting + updating bugs - but I need release notes to know what you have changed, and what's worth re-trying (or trying that didn't exist before) :).

    EDIT: argh. My mistake. (and: Bad design of the standard Unity website) - There's a navbar that says literally: "Unity manual | Scripting API | Changelog" ... but the links DO NOT go to the Unity manual etc, they are for this package only. So I've found the release notes now :).

    (but it would probably be a good idea to explicitly link them from the package manual too, at least until Unity's web design team improves the design of package-minisites. Most of the other packages I've been using recently already do this, which is why I'd got used to seeing them in the manual)
     
  17. Thomukas1

    Thomukas1

    Joined:
    Sep 29, 2014
    Posts:
    20
    hi, can anyone help me out? I am using a cinemachine timeline and i want to record mp4 clip with unity recorder. However, it says "invalid frame rate" when i put in timeline a recorder clip...
    I have set timeline framerate to 30, also tried 24
     
  18. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hey @Thomukas1, you should be able to safely ignore this warning. It's a known bug we haven't had a chance to tackle yet but the recording should still work.

    Are the the recorded files not getting generated on disk?
     
  19. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    594
    May someone let me know if the issue with low quality mp4 (even when high option is selected) is fixable on 2019.2?

    Is it fixed on 2019.3?

    Do I have to use legacy encoder?

    How does ffmpegencoder extension help, and if it does, why can't recorder ship with it by default? https://github.com/keijiro/FFmpegRecorder
     
  20. Thomukas1

    Thomukas1

    Joined:
    Sep 29, 2014
    Posts:
    20
    Hi, sorry for not answering, i forgot to check this page... I am ignoring the message of invalid frame rate and the recorder records fine in the timeline.
    About the lag, it looks like recorder takes up a lot of memory and so my framerate drops significantly, even if im recording at 240p.

    Also, another issue appeared out of nowhere. When i am recording, the timing of my animations speed up, and are way much faster the the video player in the scene. However, if i set recording fps to 60, the animations play much slower. It worked fine before, the speeds were the same both when recording and when not.
     
  21. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    34
    I just wanted to reiterate how much having this (the MovieRecorder) available in builds would be incredibly useful. It could just be the C# API that is exposed (no need to have all the editor windows sync up). Right now it's quite a major pain to record gameplay on different platforms -- the fact that Unity Recorder is already integrated with the ScriptableRenderPipeline makes this *so* close, too!
     
  22. Thomukas1

    Thomukas1

    Joined:
    Sep 29, 2014
    Posts:
    20
    The framerate differed because i had somehow switch from 1080p to 2160p. my computer is too weak for that. By the way, i would still like to know how to optimize the recorder?..
     
  23. kidsfab

    kidsfab

    Joined:
    Oct 16, 2018
    Posts:
    3
    Hello All,
    I am currently working on a project in which I animate (hands and facial mocap) a character and record my voice.

    I am recording the audio with an external app (audacity) that I start at roughly the same time than the recorder in unity.

    I am setting the recorder to record 60 seconds. I have set up the frames to 60 fps, constant and with the cap box checked. When I record a video, the audio is unmatchable in post processing, as the video seems to be recorded faster that 60fps. Seeing others also have trouble with Video recording, I have switched to recording the animation (blend shapes and Transforms) instead.

    I thus launch both the recorder and my audio recording (external app) at the same time but the planned 60 seconds end up being 106s. The animation once in Timeline has 3600frames, as it should be expected for a 60s long 60fps animation. My audio in the external app Audacity is however 106s long.

    When I bring it in Timeline, I have to fiddle with the animation clip's "speed multiplier" in order to have the audio match the animation. 60/106=0.566 seems to fit but the math isn't correct as I am starting the recordings manually with a +/- 1s delay.

    This is unfortunately currently unusable.

    My question is thus the following : could this be my non-beefy hardware struggling to render and record the animations? or a problem with the recorder in keeping up with the clock?

    Thanks for keeping this thread alive and possibly finding an answer.
     
  24. opennoise

    opennoise

    Joined:
    Jun 4, 2018
    Posts:
    19
    Hi! I'm using Unity Recorder 2.1.0 on Unity version 2019.2.17. I'm trying to capture a 1080p mp4 from Game Mode. Every time I use recorder, it all seems to be working properly, but when I stop recording, I get thrown this error in the console.

    VideoMediaEncoder::~VideoMediaEncoder 487 encoding errors.
    UnityEditor.Recorder.BaseTextureRecorder`1:ReadbackDone(AsyncGPUReadbackRequest)

    And then when I check out the video file, it doesn't open, saying it's corrupted. Does anyone know how to fix this?
     
  25. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    152
    Using Recorder 2.1.0-preview package with Unity 2018.4.18f
    I'm running into this ArguementNullException issue when trying to start the recording manually via script. I get this error in the console and the very first frame of the recording is dropped, which is a bummer because I'm attempting to make a looping GIF.
    Any thoughts what is going on?
    For reference, my setup is basically a modified version of the Example script from the Unity Asset store version of Recorder. (FYI I had this same error occur with the asset store version as well)


    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Recorder.GIFRecorder.RecordFrame (UnityEditor.Recorder.RecordingSession session) (at Library/PackageCache/com.unity.recorder@2.1.0-preview.1/Editor/Sources/Recorders/GIFRecorder/GIFRecorder.cs:39)
    UnityEditor.Recorder.RecordingSession.RecordFrame () (at Library/PackageCache/com.unity.recorder@2.1.0-preview.1/Editor/Sources/RecordingSession.cs:129)



    ArgumentNullException: Value cannot be null.
    Parameter name: textureToCopy
    UnityEngine.RenderTexture..ctor (UnityEngine.RenderTexture textureToCopy) (at C:/buildslave/unity/build/Runtime/Export/Texture.cs:132)
    UnityEditor.Recorder.TextureFlipper.Init (UnityEngine.RenderTexture template) (at Library/PackageCache/com.unity.recorder@2.1.0-preview.1/Editor/Sources/TextureFlipper.cs:19)
    UnityEditor.Recorder.TextureFlipper.Flip (UnityEngine.RenderTexture target) (at Library/PackageCache/com.unity.recorder@2.1.0-preview.1/Editor/Sources/TextureFlipper.cs:25)
    UnityEditor.Recorder.Input.CameraInput.NewFrameReady (UnityEditor.Recorder.RecordingSession session) (at Library/PackageCache/com.unity.recorder@2.1.0-preview.1/Editor/Sources/Recorders/_Inputs/Camera/CameraInput.cs:354)
    UnityEditor.Recorder.Recorder.SignalInputsOfStage (UnityEditor.Recorder.ERecordingSessionStage stage, UnityEditor.Recorder.RecordingSession session) (at Library/PackageCache/com.unity.recorder@2.1.0-preview.1/Editor/Sources/Recorder.cs:201)
    UnityEditor.Recorder.RecordingSession.RecordFrame () (at Library/PackageCache/com.unity.recorder@2.1.0-preview.1/Editor/Sources/RecordingSession.cs:126)
     
    Last edited: Mar 3, 2020
  26. razo84

    razo84

    Joined:
    Jan 15, 2017
    Posts:
    21
    @cguertin Hi, sorry for late reponse (I thought I already answered, now I realized I didn't :)

    The issue is gone, it was most likely on the Package Manager side and happened during upgrade from 2019.2 to 3. Strange thing is that even after deleting and rebuilding Library, I was still presented old Recorder version as the latest. Once I migrated the project to fresh new 2019.3 project (in my case just move Assets folder), I was able to get the latest version in Package Manager. Hope that helps anybody.
     
    cguertin likes this.
  27. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hi @bitinn! The codec options have not yet changed in 2019.3 but being able to output high quality videos from the Recorder is something very important for us that is being worked on.

    Keijiro's FFmpegRecorder is a community project being developed independently outside of Unity. I have not tested it but I believe it allows to adjust the encoding settings which could help with your situation in the meantime.

    Another option we can recommend would be to Record an image sequence and then encode it in another software if it's possible for you.
     
    bitinn likes this.
  28. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hi @Thomukas1! The video player de-sync is a known issue but we don't have a fix at the moment unfortunately. You can check out this thread for a more detailed explanation of the problem https://forum.unity.com/threads/timeline-recorder-and-video-timing.560020/#post-3713914

    In terms of optimization, the biggest impact would be the output resolution and the number of Recorders (if you have more than one recording at the same time). Even if the engine is able to render in real-time for each frame we still need to pull the rendered data from the GPU, encode it depending on the file format, and save the file to disk. As the resolution goes up those operations take longer and the Recorder may not be able to stay "real-time" during the recording. But even if the Recorder slows down, the output file will look as expected when played back (with the exception of the video player at the moment).
     
  29. cguertin

    cguertin

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    31
    Hey @opennoise, sorry to hear you are having this issue. I tried reproducing the issue from a new projects but wasn't able to get the same result. Could you please provide the following information so we can dig further:
    1 - Are you using the Recorder clips (timeline) or the Recorder Window to start the recording?
    2 - If using the Recorder window, which record mode is used (manual, frame interval, time interval)

    Thanks!
     
  30. Thomukas1

    Thomukas1

    Joined:
    Sep 29, 2014
    Posts:
    20
    Thank you I am looking forward to a fix of de-sync
     
  31. rosssssss

    rosssssss

    Joined:
    Jan 27, 2017
    Posts:
    25
    Hello! I'm trying to use the Unity Recorder for recording some 360 video from within the editor. It all works great when I put the settings into the editor window and hit Start Recording but i can't seem to get it to work from script. Is there an example that does this anywhere?
    Here's what i've got:
    Code (CSharp):
    1.             var settings = ScriptableObject.CreateInstance<RecorderControllerSettings>();
    2.             var imageRecorder = ScriptableObject.CreateInstance<MovieRecorderSettings>();
    3.  
    4.             imageRecorder.OutputFormat = MovieRecorderSettings.VideoRecorderOutputFormat.MP4;
    5.  
    6.             imageRecorder.ImageInputSettings = new Camera360InputSettings
    7.             {
    8.                 Source = ImageSource.MainCamera,
    9.                 OutputWidth = 1920,
    10.                 OutputHeight = 1080,
    11.                 StereoSeparation = 0.065f,
    12.                 CameraTag = "MainCamera"
    13.             };
    14.  
    15.             settings.AddRecorderSettings(imageRecorder);
    16.             recorderController = new RecorderController(settings);
    17.  
    18.             Debug.Log("Start Recording: " + imageRecorder.OutputFile);
    19.  
    20.             Debug.Assert(recorderController.StartRecording());
    21.             Debug.Assert(recorderController.IsRecording());
    22.  
    when i call this function it throws a Null Reference error on line 74 on Camera360Input.cs - which is targetCamera being null i think. Any clues greatly appreciated!
    Thanks
     
  32. rosssssss

    rosssssss

    Joined:
    Jan 27, 2017
    Posts:
    25
    Ah, weird that's actually working now like that... sorry!
     
    cguertin likes this.
  33. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,143
    Is the _Time variable available in shaders supposed to be working?

    I have a wind-system that behaves fine in regular playmode but looks erratic when recording a video with Recorder - and it's worse when storing to individual files (which is slower) than when recording to a video (which gives us compression artifacts).
     
  34. Lukiioii

    Lukiioii

    Joined:
    Mar 12, 2020
    Posts:
    1
    Hi there,

    Many thanks for providing this recording tool, and it works well for me in GUI manual mode. I'm new to Unity and wondering if we could run this recorder tool from a script, say launch Unity by command-line arguments and then automatically start playing and recording a movie?

    I tried to launch Unity by command-line argument with "-executeMethod <ClassName.MethodName>", and what I've got is:
    Code (CSharp):
    1. using UnityEditor;
    2.  
    3. class autoRun
    4. {
    5.     static void play()
    6.     {
    7.         UnityEditor.EditorApplication.isPlaying = true;
    8.  
    9.     }
    10. }
    This script can simply play my animation when Unity launched. So anyone can help me and provide some code to start the recorder? And how to pass the parameters like frames indexes, FPS, output format?

    Thanks in advance!
     
  35. FORNya

    FORNya

    Joined:
    Nov 2, 2018
    Posts:
    4
    I try to use CaptureScreenShotExample on Unity Recorder 2.1.0-preview.1.
    However
    DefaultWildcard.Take
    has invalid characters for
    Path.Combine()
    and I got errors in 26 lines on runtime.

    The original is this.
    Code (CSharp):
    1. imageRecorder.OutputFile = Path.Combine(mediaOutputFolder, "image_" + DefaultWildcard.Take);
    I fix it with:
    Code (CSharp):
    1. imageRecorder.OutputFile = mediaOutputFolder + "/image_" + DefaultWildcard.Take;
    Do maintainers fix this issue?
     
  36. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    218
    I can't see any of this in the documentation. Is that normal? Your tool is great but we need more info to use it.
     
unityunity