Search Unity

Video Unity Recorder update

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

  1. grahamvr

    grahamvr

    Joined:
    Feb 20, 2017
    Posts:
    13
    Hey folks, is there a way of rendering out stereoscopic images using Volumetric fog where you cant see the cubemap overlay on the output image?
     
    LargoSama likes this.
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,864
    Could someone maybe give me a quick explanation of what this package is useful for? In what ways are people using it?

    I found this package while looking for a screen recording tool I could use in a build, to capture camera output to allow players to share gifs/videos of their gameplay. And I see in this thread that this package isn't intended to work in builds, or doesn't work in builds. But then I see recent fixes to this package claiming to have fixed issues with iOS builds. So I'm confused about whether this is actually supported or not for recording in a build.

    I also see that under 2019.2, additional integration with HDRP was added, allowing recorder output to be fed into shaders? What's the point of this if it's not usable in a build?

    So what's the story with this package? Why does it exists if it can't be used in a build? Compared to recording with OBS Studio, or any other screen recording software, what's the reasoning for using this package? Is it especially efficient when recording Unity or something?

    Sorry if this sounds like I'm complaining. I'm just having a hard time understanding the value of an editor-only screen recording package.
     
  3. Rik_Vasquez

    Rik_Vasquez

    Joined:
    Aug 24, 2015
    Posts:
    7
    @dgoyette, I use it for cinematics or video production projects. If you're familiar with vfx, video compositing, or video post-processing workflow there's a need to render in "passes" (foreground elements from background, lighting passes, z-depth even, and such). Or exporting out in HD res, still frames. That's I think, in part, what Unity Tech's plan and motivation for this tool's development. A game engine version of a non-linear video editor (or one aspect of it when combined with timeline and cinemachine). It's relatively new so in preview builds there will be bugs.

    Recording efficiency? Speaking from my limited user experience, it will depend on your goals and computer hardware specs. If you throw in a lot of particle fx or post process effects and want to capture that in realtime, if you have low end hardware, the video output might have glitches or frame rate drops. So to avoid something like this you may have to set the recorder to output still frames. And re-build your sequence in an external video editor.
     
    Last edited: Aug 13, 2019
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,864
    You've mentioned a couple of interesting things there. So you might use this to create a cutscene video with fewer artifacts than if the screen were merely recorded with standard screen recording software? Meaning, if the recorder doing something different than just capturing the computer's screen output? Does the recorder somehow get lower-level rendering output it uses to generate videos? Is there something you were able to achieve using Unity Recorder that would have been difficult or not possible just capturing the screen?
     
  5. Rik_Vasquez

    Rik_Vasquez

    Joined:
    Aug 24, 2015
    Posts:
    7
    To answer your last question, I was able to record the game screen playback (i.e., no ui). If I were using Bandicam for example, I'd need to customized my ui layout to maximize the game panel but it won't crop it completely (from my experience using Bandicam to capture Unity). There's a few more output modes too like 360 but I've yet to try this. The record "animation clip" can be useful.

    For cutscene recording or even video assets for marketing purposes or store thumbnail videos, it's pretty efficient to use and straightforward. If you have a high end rig, you might be okay doing obs captures and just clip what you need in obs. But I don't have practical experience with this.

    Lower level rendering? For my own tests and my low spec laptop I'm fine capturing still frames with post-processing. I won't be attempting to render 60fps videos at 1080 and up (I think it'll let you do 4k) until I get a beefier rig. So, it can really depend on what computer you have.
     
    Last edited: Aug 11, 2019
    dgoyette likes this.
  6. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    161
    Hi @marief_unity I ran into this error, and ran into a couple problems with this fix: First there was an issue with a missing comma in that code (which I figured out how to get around with a json validator I found here: https://jsonlint.com/) and after I seemed to get it working OK, I got this error:

    Assembly has duplicate references: Unity.Recorder,Unity.Timeline (Assets/Unity Recorder/Editor/Unity.Recorder.Editor.asmdef)

    Could not figure out how to get around that one. Any suggestions?

    Thanks!
     
  7. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    161
    Hi again @marief_unity, I found the answer to my own question, once I had a chance to dig around this thread some more this morning, here in this post:

    https://forum.unity.com/threads/unity-recorder-update.509458/page-9#post-4664957

    ...where you said:

    I was using the version from the Asset Store. Don't remember seeing it saying anything about it only being compatible with < 2018.3, but I was in a hurry. :) And I had first tried to download via Package Manager, but didn't know about the "show preview package" option.

    Working now, thanks!
     
    marief_unity likes this.
  8. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    113
    Hey @dgoyette,

    As @Rik_Vasquez well explained, the main goal of Recorder is to output data (images, movies, animations, ...) so they can be re-used in other DCC / pipeline steps.
    So it was really designed with the VFX / Animation / Cinematics in mind.

    An advantage of Recorder is you can stack the Recorders and export at the same time, your animation and your final render OR now all your AOVs and a proxy movie of your beauty. You can also export different camera targets at the same time.

    I confirm it does not work at runtime, the build fixes you saw were about allowing the build itself to succeed with a Recorder in your project. Having Recorder working at runtime is not a priority right now.

    Priority currently being:
    * stabilization and bug fixes
    * improving encoding quality set-up

    Thanks for your interest.
     
    dgoyette likes this.
  9. calvinstreeting

    calvinstreeting

    Joined:
    Jun 14, 2019
    Posts:
    9
    can anyone help with this.. when i add recoder preview and open window add movie as a recoder i get no controls like file name and this error repeats over and over again in console :( ....


    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Recorder.Input.GameViewSize.GetMainGameView () (at Packages/com.unity.recorder/Editor/Sources/Recorders/_Inputs/GameViewSize.cs:23)
    UnityEditor.Recorder.Input.GameViewSize.GetGameRenderSize (System.Int32& width, System.Int32& height) (at Packages/com.unity.recorder/Editor/Sources/Recorders/_Inputs/GameViewSize.cs:43)
    UnityEditor.Recorder.OutputResolution.GetWidth () (at Packages/com.unity.recorder/Editor/Sources/OutputResolution.cs:26)
    UnityEditor.Recorder.Input.StandardImageInputSettings.get_outputWidth () (at Packages/com.unity.recorder/Editor/Sources/ImageInputSettings.cs:35)
    UnityEditor.Recorder.FileNameGenerator.ResolutionResolver (UnityEditor.Recorder.RecordingSession session) (at Packages/com.unity.recorder/Editor/Sources/FileNameGenerator.cs:197)
    UnityEditor.Recorder.Wildcard.Resolve (UnityEditor.Recorder.RecordingSession session) (at Packages/com.unity.recorder/Editor/Sources/FileNameGenerator.cs:35)
    UnityEditor.Recorder.FileNameGenerator.ApplyWildcards (System.String str, UnityEditor.Recorder.RecordingSession session) (at Packages/com.unity.recorder/Editor/Sources/FileNameGenerator.cs:278)
    UnityEditor.Recorder.FileNameGenerator.BuildAbsolutePath (UnityEditor.Recorder.RecordingSession session) (at Packages/com.unity.recorder/Editor/Sources/FileNameGenerator.cs:229)
    UnityEditor.Recorder.FileNameGeneratorDrawer.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Packages/com.unity.recorder/Editor/Sources/FileNameGeneratorDrawer.cs:101)
    UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyDrawer.cs:23)
    UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:139)
    UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:106)
    UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:208)
    UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9456)
    UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:9445)
    UnityEditor.Recorder.RecorderEditor.NameAndPathGUI () (at Packages/com.unity.recorder/Editor/Sources/RecorderEditor.cs:104)
    UnityEditor.Recorder.RecorderEditor.OnInspectorGUI () (at Packages/com.unity.recorder/Editor/Sources/RecorderEditor.cs:70)
    UnityEditor.Recorder.RecorderWindow.OnRecorderSettingsGUI () (at Packages/com.unity.recorder/Editor/Sources/RecorderWindow.cs:855)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:280)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  10. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    113
    Hey @calvinstreeting,

    Your log might suggest you are not using the last version of Recorder.
    So a first try would be to update Recorder to the last version available and Unity to its last minor version.

    If that does not resolve your issue, please open a new thread and add the "recorder" tag on it so we can discuss this more efficiently.

    Please also provide those information :
    - Unity version
    - OS version
    - Recorder version
    - Other package your are using (HDRP ? Timeline ?)

    Does this happens in an empty project ?
     
  11. marwi

    marwi

    Joined:
    Aug 13, 2014
    Posts:
    24
    In RecorderController.cs is a check for errors which is fine but you forgot to Log the errors when I actually have them:




    And just out of curiousity: Why do you mark methods like ValidityCheck as internal?
     
  12. PwC-CZ

    PwC-CZ

    Joined:
    Aug 5, 2019
    Posts:
    1
    Hi folks,

    360 Capture problem: In the scene I am using particle systems (smoke), but these aren't recorded on 360 images / video. When using 2D, everything is captured as expected. Any idea, how to solve it?

    Looking forward to Your suggestions,
    Martin
     
  13. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    113
    Hey @marwi !
    Indeed, thanks for reporting. One char fix should make the cut for next release.

    I guess because we didn't want it to be accessible until a proper API is defined.

    Right now Recorder's public API is minimalist, it allows to create Recorder instances, set them up and trigger the Record, only.

    We plan to extend this API to allow users to extend Recorder type (and be able to create new type of Recorders, outside of Recorder package). So we will have to define which functions to publicly expose and probably refactor a bit in order to have an API that allows flexibility but is also coherent and stable.
     
  14. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    113
    Hi @PwC-CZ,

    Indeed this is a bug. It needs investigation, I added an issue in our backlog.
    Can't give you an ETA yet.

    Sorry about that and thanks for reporting !
     
  15. calvinstreeting

    calvinstreeting

    Joined:
    Jun 14, 2019
    Posts:
    9
    Hi.. Fixed my issue thanks for tip on posting in dif forum. :)

    but i have another question: I know recorder cannot be scripted at run time, but can it be scripted in the editor to dump out 86 + animations of a map ? please say yes as really dont want to click record that many times :)
     
  16. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    113
    Hey @calvinstreeting,

    There's an API that allows to create recorders and set them up.

    You can import the sample codes on Recorder package page in Package Manager window.
     
  17. calvinstreeting

    calvinstreeting

    Joined:
    Jun 14, 2019
    Posts:
    9
    ok looking at the api, seems simple enough... but led to another question

    I have a loop that takes a list of corods and moves camera to x posistion and dump out the video
    "controllerSettings.SetRecordModeToTimeInterval(0,120);" for a 2 min loop and move onto next but when you call

    "m_RecorderController.StartRecording();"

    it dosn't wait for completion the code carries on so i put a loop in like this

    Code (CSharp):
    1. m_RecorderController.StartRecording();
    2. do
    3. {
    4.     Console.WriteLine("doing stuff");
    5.  
    6. } while (m_RecorderController.IsRecording());
    7. m_RecorderController.StopRecording();
    it dosnt stop :( as StopRecording need to be pressed so that IsRecording is say i havet stoped it yet :)

    is there a metod to make it wait until done etc?

    Many thanks
     
  18. BATTLEKOT

    BATTLEKOT

    Joined:
    Oct 2, 2016
    Posts:
    39
    I can render video with hinger bitrate like 20.000 ?
     
  19. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    113
    Hey @calvinstreeting,

    I doubt this can work with Recorder implementation, cause Recording session is related to play mode.

    But I would try to do it the other way around : set-up cameras and Recorders with tagged camera capture target, and then start the Recording session.

    Code (CSharp):
    1.  
    2. For position in list of positions
    3.     Create new camera, place it to position, and tag it
    4.     Create a Recorder that capture the tagged camera
    5. Start Recording
    6.  
    I did quick test, setting up 86 Movie Recorders and then start a recording session of few seconds. It worked.
    The bottleneck will probably be when your 2 minutes recording session stops, as it then will need to write all final movies. It finished withing 15 seconds on my laptop.

    If that doesn't work, please open a new thread and be more specific about what exactly you are trying to do. There are might be other solutions considering your use case.
     
    calvinstreeting likes this.
  20. marief_unity

    marief_unity

    Unity Technologies

    Joined:
    Oct 9, 2018
    Posts:
    113
    Hey @BATTLEKOT,

    Not sure what hinger means, but right now, only legacy MP4 / Webm Recorders offer a bitrate field. Their main limitation is no audio capture is available.
    To access legacy Recorders, you need to enable the option in Window > General > Recorder > Options > Show Legacy Recorders.
     
    BATTLEKOT likes this.
  21. mikemonroe_oc

    mikemonroe_oc

    Joined:
    Dec 7, 2016
    Posts:
    4
    Hi, I have a specific setup that is relying on the Capture: Game View setup from Recorder's UI panel. I'm trying to move this to a scripted recording, however I'm noticing that I can't specify Game View as a source in the CameraInputSettings init.


    Code (CSharp):
    1.  
    2.         imageRecorder.imageInputSettings = new CameraInputSettings
    3.         {
    4.             source = ImageSource.MainCamera,
    5.             outputWidth = 2560,
    6.             outputHeight = 720,
    7.             captureUI = false
    8.         };
    9.  
    10.  
    11. public enum ImageSource
    12. {
    13. ActiveCamera = 1,
    14. MainCamera = 2,
    15. TaggedCamera = 4
    16. }
    17.  
    Am I missing something obvious here? Is there a way to do this via script?
     
  22. marwi

    marwi

    Joined:
    Aug 13, 2014
    Posts:
    24
    Well right now it feels like a madeup barrier - I'd rather take into account changing APIs due to preview state or major changes in the package than having to hack around a not exposed API.
    If you're concerned about users being upset about API changes you could either add a note in the method descriptions and/or add a custom compiler warning.

    For example you create a List of Recording Session Cameras that I can not access because the Session class is private and the List itself is internal.
    Additionally Recording a normal ImageFrame with Manual Mode, StartRecording and EndRecording in HDRP 6.9.1

    I tried to reproduce that in the "CaptureScreenShotExample". Clicking Play in an empty scene throws:
    Code (CSharp):
    1. ArgumentException: Illegal characters in path.
    2. System.IO.Path.Combine (System.String path1, System.String path2) (at <a8ed250850854b439cedc18931a314fe>:0)
    3. UnityEngine.Recorder.Examples.CaptureScreenShotExample.OnEnable () (at Assets/Samples/Unity Recorder/2.0.2-preview.3/Screenshot Capture Sample/CaptureScreenShotExample.cs:35)
    because of "DefaultWildcard.Take"