Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

NatCorder - Video Recording API

Discussion in 'Assets and Asset Store' started by Lanre, Nov 18, 2017.

  1. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Hm that's very curious. What device are you running on, and what is your recording resolution?
     
  2. DigitalBeach

    DigitalBeach

    Joined:
    Jan 17, 2015
    Posts:
    37
    Has anyone got it to work on iOS so you can move a video from the private app location where it is stored to a public location you can access like the Photos gallery so it can be accessed and mailed or such?

    ReplayKit does this well but I can't find a way to do that with this plugin.
     
  3. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Check out our NatShare API.
     
  4. DigitalBeach

    DigitalBeach

    Joined:
    Jan 17, 2015
    Posts:
    37
    Thanks. Will do. I also found out that by setting iTunesFileSharing I can access the files remotely.
     
    Lanre likes this.
  5. texnoline21

    texnoline21

    Joined:
    Feb 6, 2016
    Posts:
    12
    Hello.
    With the most recent version of Vuforia 8.0+, Screen Space - Camera is no longer supported. Tell me, is there a way to add user interface elements to the video?
     
    whuaso79 likes this.
  6. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Since NatCorder can't see Overlay UI canvases, you'll have to use a WorldSpace canvas.
     
  7. unity_noMf5kG54sxntg

    unity_noMf5kG54sxntg

    Joined:
    Nov 18, 2018
    Posts:
    4
    Hello.
    I apologize for asking simple questions.
    If I want to save video, should I use NatShare with NatCorder?
     
  8. lowfrq

    lowfrq

    Joined:
    Nov 14, 2018
    Posts:
    3
    Can someone show code for recording replays with audio? I spend much time trying update my code for v 1.51 but finaly got mp4 file with 1 kb weight. Whats im doing wrong?? (I read all documentation and examples, but there no information for this task. Thx!!

    Code (CSharp):
    1.     private Camera CurCam;
    2.     private RealtimeClock clock;
    3.     private MP4Recorder mediaRecorder;
    4.     private CameraInput cameraInput;
    5.     private AudioInput audioInput;
    6.  
    7.     void Start ()
    8.     {
    9.         CurCam = Camera.main;
    10.     }
    11.  
    12.     public void RecordStart()
    13.     {
    14.         int w,h;
    15.         if (CurCam.scaledPixelHeight < 640)
    16.         {
    17.             h = 640;
    18.             w = CurCam.scaledPixelWidth * h / CurCam.scaledPixelHeight;
    19.         }
    20.         else
    21.         {
    22.             h = CurCam.scaledPixelHeight;
    23.             w = CurCam.scaledPixelWidth;
    24.         }
    25.         clock = new RealtimeClock();
    26.         mediaRecorder = new MP4Recorder(w,h,30,32000,2,GetVideo);
    27.         cameraInput = new CameraInput(mediaRecorder, clock, CurCam);
    28.         audioInput = new AudioInput(mediaRecorder, clock, CurCam.GetComponent<AudioListener>());
    29.  
    30.     }
    31.  
    32.     public void RecordStop()
    33.     {
    34.         cameraInput.Dispose();
    35.         audioInput.Dispose();
    36.         mediaRecorder.Dispose();
    37.         mediaRecorder = null;
    38.     }
    39.  
    40.     void OnPostRender()
    41.     {
    42.         if (mediaRecorder != null)
    43.         {
    44.             RenderTexture frame = mediaRecorder.AcquireFrame();
    45.             Debug.Log(CurCam.activeTexture);
    46.             Graphics.Blit(CurCam.activeTexture, frame);
    47.             mediaRecorder.CommitFrame(frame, clock.Timestamp);
    48.         }
    49.     }
    50.  
    51.     public void OnAudioFilterRead (float[] data, int channels)
    52.     {
    53.         if (mediaRecorder != null)
    54.             mediaRecorder.CommitSamples(data, clock.Timestamp);
    55.     }
    56.  
    57.     void GetVideo(string path)
    58.     {
    59.         NatShare.Share(path);
    60.     }
    61. }
     
  9. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    By save, I presume you mean copying the video to the camera roll. If so, yes, use NatShare with NatCorder.
     
    unity_noMf5kG54sxntg likes this.
  10. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Your code has a few issues. First, you should either use an Input script, or manually commit frames (calling IMediaRecorder.Commit...). Your code is doing both. Second, your aspect scaling code (for calculating w and h) will can easily run into an issue where w is 0, since you are performing integer division. Third, you are using OnPostRender to commit video frames, but doing this requires that the script be attached to a game camera.
     
  11. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    @Skjalg and @Menion-Leah can you both email me with your invoice numbers? I've been working on a NatCorder on Steroids branch that uses AsyncGPUReadback for recording. The result is a zero-millisecond performance cost on recording each frame (there's still GC allocation though). This branch requires Unity 2018.3 at least (Unity only made their AsyncGPUReadback::GetData::ToArray implementation efficient in this version). The improvements affect Windows, macOS (now requires Metal exclusively, like on iOS), and iOS. The branch doesn't support WebGL for the time being.
     
    edee1337 and Menion-Leah like this.
  12. jbvobling

    jbvobling

    Joined:
    Sep 26, 2017
    Posts:
    27
    I have two devices, Samsung S7 edge and Samsung Galaxy Tab S4, the startRecording is working in Samsung S7 Edge when i click the button but in Samsung Galaxy Tab S4, the app is hanged....

    upload_2019-4-5_19-27-41.png

    any idea why?
     
  13. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Can you share the full logs from logcat in a .txt file? Don't filter for Unity tags like you did in your screenshot.
     
  14. pixelworshipco

    pixelworshipco

    Joined:
    Sep 29, 2016
    Posts:
    6
    I was seeing something similar and realized microphone permissions weren't turned on.

    NatCam, why is audio recording so glitchy on Android? I am running the latest 1.5.1 (upgrade from 1.4 which had the exact same issue). Even your sample ReplayCam scene on Pixel 2 devices begins stuttering during playback (audio specifically). It may stutter on the first video recorded or it may be the 10th. It's very intermittent. It's definitely in the encoding as sharing the stuttering video to my email results in the same issue.

    Sample video:
     

    Attached Files:

  15. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    If you are using Unity's Microphone API, this is expected. Unity's Microphone API often produces glitchy audio. That is why we introduced our NatMic plugin.
     
  16. pixelworshipco

    pixelworshipco

    Joined:
    Sep 29, 2016
    Posts:
    6
    VERY good to know! Thank you. I will purchase and give it a shot.
     
    Lanre likes this.
  17. anatoogle

    anatoogle

    Joined:
    May 25, 2018
    Posts:
    6
    I'm using Natcorder on my Android with ARCore, but I'm having trouble with my video output. After recording and viewing the mp4 with a video player like VLC, everything looks fine. But after importing the file in a editing software like DaVinci Resolve (even Blackmagic Fusion, The Foundry Nuke, etc.) there are some errors.
    - Each Software show me a different number of recorded frames (the video length varies)
    - Some frames are freezed / same as the previous frame
    - It seems that some frames getting an offset (after a freeze frame, the next frames are a few frames ahead until the next freeze frame)
    I'm using the provided ReplayCam script and record 1920x1080 on 30 fps.
    Any idea what might cause my problem?
     
  18. jbvobling

    jbvobling

    Joined:
    Sep 26, 2017
    Posts:
    27
    The crash disappear after i enable the microphone manually. Thank you very much. Although the problem is the same as what you encountered in android, glitching when I use the Mono in Audio Settings of unity...
     
    Last edited: Apr 10, 2019
  19. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    This is really weird, since the video plays fine in MP4 players. Try inspecting the video file with `mediainfo` for any clues.
     
  20. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Unity's microphone API produces glitchy audio. That is why we created NatMic.
     
  21. adre

    adre

    Joined:
    Mar 28, 2014
    Posts:
    38
    Whenever i enable Record Audio flag in replay video scene and i test on Android, it crashes and closes the app.
    I don't need good audio, would just be fine to have a video with an empty audio track, to concat videos with ffmpeg. Microphone permission is granted.
    Any clue?
     
    Last edited: Apr 11, 2019
  22. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Can you upload the full logs from logcat in a .txt file? The logs will contain the reason for the crash.
     
  23. poprev-3d

    poprev-3d

    Joined:
    Apr 12, 2019
    Posts:
    71
    I'm trying to use the asset very simply to record my main camera video output but i go many issues trying to make it work.

    The first error is that the mp4 file created is 1Kb one time out of two (it' very random). Am I doing something wrong ?

    The other error is that Unity crashes often due to memory alloc problems and many strange errors if the video lasts around more than 10 secs. Sometimes it works but it's very random. Mainly i got memory alloc issues and unity crashes (I have 16gig of ram and a 2060 though ...)
    Errors are like "Fatal error in gc" or "videoalloc remaping failed" or something like this. I can't screenshot it because crashes almost instantly

    I'm using unity 2018.1.9f2, is there any known compatibility issue with this version ?

    Code (CSharp):
    1.         public bool isRecording;
    2.  
    3.         public RealtimeClock recordingClock;
    4.         public MP4Recorder videoRecorder;
    5.         public CameraInput cameraInput;
    6.  
    7.         public void StartRecording()
    8.         {
    9.             // Start recording with NatCorder
    10.             Debug.Log("Start Recording");
    11.             isRecording = true;
    12.             var sampleRate = 0;
    13.             var channelCount = 0;
    14.             recordingClock = new RealtimeClock();
    15.             videoRecorder = new MP4Recorder(1280, 720, 30, sampleRate, channelCount, OnRecording);
    16.             cameraInput = new CameraInput(videoRecorder, recordingClock, Camera.main);
    17.  
    18.         }
    19.  
    20.         public void EndRecording()
    21.         {
    22.             // Stop recording video
    23.             Debug.Log("Stop recording video");
    24.             cameraInput.Dispose();
    25.             videoRecorder.Dispose();
    26.             isRecording = false;
    27.         }
    28.  
    29.         void OnRecording(string path)
    30.         {
    31.             Debug.Log("Ended recording video :"+path);
    32.         }
    Thanks :)
     
    Last edited: Apr 15, 2019
    ViniciusPFaria likes this.
  24. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    What platform does this happen on? I've never heard of this before.
    Is this in the Editor? I'm working on an update that will fix memory issues like this, but it requires 2018.3.
     
  25. poprev-3d

    poprev-3d

    Joined:
    Apr 12, 2019
    Posts:
    71
    I could take some logs and screenshot :




    UnityEngine.Texture2D:GetRawTextureData()
    NatCorder.Readback.BlockingReadback:Readback(RenderTexture, Action`1) (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\Readback\BlockingReadback.cs:52)
    NatCorder.Platforms.MediaRecorderiOS:CommitFrame(RenderTexture, Int64) (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\Platforms\MediaRecorderiOS.cs:48)
    NatCorder.MP4Recorder:CommitFrame(RenderTexture, Int64) (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\MP4Recorder.cs:95)
    NatCorder.Inputs.CameraInput:OnFrame() (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\Inputs\CameraInput.cs:73)
    NatCorder.Dispatch.<OnFrame>c__Iterator0:MoveNext() (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\Dispatch\DispatchUtility.cs:47)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    UnityEditor.EditorGUIUtility:INTERNAL_CALL_RenderGameViewCamerasInternal(RenderTexture, Int32, Rect&, Vector2&, Boolean)
    UnityEditor.EditorGUIUtility:RenderGameViewCamerasInternal(RenderTexture, Int32, Rect, Vector2, Boolean) (at C:\buildslave\unity\build\artifacts\generated\bindings_old\common\Editor\EditorGUIUtilityBindings.gen.cs:638)
    UnityEditor.GameView:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\GameView\GameView.cs:764)
    System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
    System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:291)
    UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:284)
    UnityEditor.HostView:InvokeOnGUI(Rect) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:251)
    UnityEditor.DockArea:OldOnGUI() (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:386)
    UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:212)
    UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent(Event) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:372)
    UnityEngine.Experimental.UIElements.IMGUIContainer:DoRepaint(IStylePainter) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:70)
    UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:677)
    UnityEngine.Experimental.UIElements.Panel:PaintSubTreeChildren(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:693)
    UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:681)
    UnityEngine.Experimental.UIElements.Panel:Repaint(Event) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:722)
    UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:208)
    UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:77)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Modules\IMGUI\GUIUtility.cs:184)
    [C:\buildslave\unity\build\Runtime/Modules/LoadDylib.cpp line 213]
    (Filename: Assets/projecttest/Dependencies/NatCorder/Plugins/Managed/Readback/BlockingReadback.cs Line: 52)
    Could not load symbol mono_unity_unlock_dynamic_function_access_tables64 : La procédure spécifiée est introuvable.
    f
    UnityEngine.Texture2D:GetRawTextureData()
    NatCorder.Readback.BlockingReadback:Readback(RenderTexture, Action`1) (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\Readback\BlockingReadback.cs:52)
    NatCorder.Platforms.MediaRecorderiOS:CommitFrame(RenderTexture, Int64) (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\Platforms\MediaRecorderiOS.cs:48)
    NatCorder.MP4Recorder:CommitFrame(RenderTexture, Int64) (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\MP4Recorder.cs:95)
    NatCorder.Inputs.CameraInput:OnFrame() (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\Inputs\CameraInput.cs:73)
    NatCorder.Dispatch.<OnFrame>c__Iterator0:MoveNext() (at Assets\projecttest\Dependencies\NatCorder\Plugins\Managed\Dispatch\DispatchUtility.cs:47)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\buildslave\unity\build\Runtime\Export\Coroutines.cs:17)
    UnityEditor.EditorGUIUtility:INTERNAL_CALL_RenderGameViewCamerasInternal(RenderTexture, Int32, Rect&, Vector2&, Boolean)
    UnityEditor.EditorGUIUtility:RenderGameViewCamerasInternal(RenderTexture, Int32, Rect, Vector2, Boolean) (at C:\buildslave\unity\build\artifacts\generated\bindings_old\common\Editor\EditorGUIUtilityBindings.gen.cs:638)
    UnityEditor.GameView:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\GameView\GameView.cs:764)
    System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
    System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:291)
    UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:284)
    UnityEditor.HostView:InvokeOnGUI(Rect) (at C:\buildslave\unity\build\Editor\Mono\HostView.cs:251)
    UnityEditor.DockArea:OldOnGUI() (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:386)
    UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI(Event) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:212)
    UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent(Event) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:372)
    UnityEngine.Experimental.UIElements.IMGUIContainer:DoRepaint(IStylePainter) (at C:\buildslave\unity\build\Modules\UIElements\IMGUIContainer.cs:70)
    UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:677)
    UnityEngine.Experimental.UIElements.Panel:PaintSubTreeChildren(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:693)
    UnityEngine.Experimental.UIElements.Panel:PaintSubTree(Event, VisualElement, Matrix4x4, Rect) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:681)
    UnityEngine.Experimental.UIElements.Panel:Repaint(Event) (at C:\buildslave\unity\build\Modules\UIElements\Panel.cs:722)
    UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch(BaseVisualElementPanel) (at C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:208)
    UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Modules\UIElements\UIElementsUtility.cs:77)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:\buildslave\unity\build\Modules\IMGUI\GUIUtility.cs:184)
    [C:\buildslave\unity\build\Runtime/Modules/LoadDylib.cpp line 213]
    (Filename: Assets/projecttest/Dependencies/NatCorder/Plugins/Managed/Readback/BlockingReadback.cs Line: 52)


    For the first error I managed to fix it, I had to set the audio the sampleRate and channelCount to 0 as I don't need the audio to be recorded :)
     
  26. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    The first error happens because you specify a non-zero sample rate and channel count without actually committing audio data (create an AudioInput or call IMediaRecorder.CommitSamples). As for this GC error, it looks weird because GC should automatically kick in and clean up memory.
     
  27. poprev-3d

    poprev-3d

    Joined:
    Apr 12, 2019
    Posts:
    71
    Can I do anything for you to diagnostic the origin of the issue ?
     
  28. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    I'm not too sure. I assume you are running on Windows 10 64-bit. Are you using the latest version of NatCorder (specifically, 1.5.1 because we fixed a memory leak on Windows in that version)?
     
  29. poprev-3d

    poprev-3d

    Joined:
    Apr 12, 2019
    Posts:
    71
    I got some news : I updated my project to 2018.3 but I still got the same problem, I think it's related to my GX 2060 but I'm not sure. here's an additionnal screenshot :



    The error occurs in the editor but also on a built version of the project

    I'm in fact running on Windows 64bit and I downloaded the NatCorder version this morning on the asset store, so it should be the last one. (It's 1.5.1 in the Changelog file)
     
  30. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    You definitely should reach out to Unity about this issue. It looks like a lower-level graphics issue.
     
  31. poprev-3d

    poprev-3d

    Joined:
    Apr 12, 2019
    Posts:
    71
    Code (CSharp):
    1.  
    2. Mono path[0] = 'E:/testapp/package_Data/Managed'
    3. Mono config path = 'E:/testapp/Mono/etc'
    4. PlayerConnection initialized from E:/testapp/package_Data (debug = 0)
    5. PlayerConnection initialized network socket : 0.0.0.0 55097
    6. Multi-casting "[IP] 172.18.80.65 [Port] 55097 [Flags] 3 [Guid] 4007025016 [EditorId] 2034863923 [Version] 1048832 [Id] WindowsPlayer(LAPTOP-BEM20VHJ) [Debug] 1 [PackageName] WindowsPlayer" to [225.0.0.222:54997]...
    7. Waiting for connection from host on [0.0.0.0:55097]...
    8. Timed out. Continuing without host connection.
    9. Started listening to [0.0.0.0:55097]
    10. Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56016
    11. PlayerConnection already initialized - listening to [0.0.0.0:55097]
    12. Initialize engine version: 2018.3.12f1 (8afd630d1f5b)
    13. GfxDevice: creating device client; threaded=1
    14. Direct3D:
    15.     Version:  Direct3D 11.0 [level 11.1]
    16.     Renderer: Intel(R) HD Graphics 530 (ID=0x191b)
    17.     Vendor:  
    18.     VRAM:     4197 MB
    19.     Driver:   25.20.100.6323
    20. Begin MonoManager ReloadAssembly
    21. - Completed reload, in  1.674 seconds
    22. <RI> Initializing input.
    23. <RI> Input initialized.
    24. <RI> Initialized touch support.
    25. WARNING: Shader Unsupported: 'Standard (Specular setup)' - Pass 'META' has no vertex shader
    26. WARNING: Shader Unsupported: 'Standard (Specular setup)' - Pass 'META' has no vertex shader
    27. WARNING: Shader Unsupported: 'Standard' - Pass 'META' has no vertex shader
    28. WARNING: Shader Unsupported: 'Standard' - Pass 'META' has no vertex shader
    29. UnloadTime: 28.722500 ms
    30. LoadLastSave
    31. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    32. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    33. UnityEngine.Logger:Log(LogType, Object)
    34. UnityEngine.Debug:Log(Object)
    35. company.SaveManager:LoadLastSave() (at C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:317)
    36. company.AssetManager:Load() (at C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Assets\AssetManager.cs:47)
    37. company.SaveManager:Load() (at C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:61)
    38. company.SaveManager:Awake() (at C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:44)
    39. (Filename: C:/Users/Username/Documents/companyappli/Assets/company/Scripts/Source/Versions/SaveManager.cs Line: 317)
    40. DirectoryNotFoundException: Directory 'E:/testapp/package_Data\../Data\Saves' not found.
    41.   at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x000f7] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:514
    42.   at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:308
    43.   at company.SaveManager.SaveFilesInfo () [0x0000c] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:210
    44.   at company.SaveManager.get_GetLastSavePath () [0x00002] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:311
    45.   at company.SaveManager.LoadLastSave () [0x0000c] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:318
    46.   at company.AssetManager.Load () [0x0006d] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Assets\AssetManager.cs:47
    47.   at company.SaveManager.Load () [0x00016] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:61
    48.   at company.SaveManager.Awake () [0x0001e] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:44
    49. (Filename: /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs Line: 514)
    50. WARNING: Shader Unsupported: 'Legacy Shaders/Diffuse' - Pass 'Meta' has no vertex shader
    51. Mono path[0] = 'C:/Users/kouellet/Documents/company/testapp/package_Data/Managed'
    52. Mono config path = 'C:/Users/kouellet/Documents/company/testapp/Mono/etc'
    53. PlayerConnection initialized from C:/Users/kouellet/Documents/company/testapp/package_Data (debug = 0)
    54. PlayerConnection initialized network socket : 0.0.0.0 55387
    55. Multi-casting "[IP] 172.18.80.65 [Port] 55387 [Flags] 3 [Guid] 151082658 [EditorId] 2034863923 [Version] 1048832 [Id] WindowsPlayer(LAPTOP-BEM20VHJ) [Debug] 1 [PackageName] WindowsPlayer" to [225.0.0.222:54997]...
    56. Waiting for connection from host on [0.0.0.0:55387]...
    57. Timed out. Continuing without host connection.
    58. Started listening to [0.0.0.0:55387]
    59. Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56658
    60. PlayerConnection already initialized - listening to [0.0.0.0:55387]
    61. Initialize engine version: 2018.3.12f1 (8afd630d1f5b)
    62. GfxDevice: creating device client; threaded=1
    63. Direct3D:
    64.     Version:  Direct3D 11.0 [level 11.1]
    65.     Renderer: Intel(R) HD Graphics 530 (ID=0x191b)
    66.     Vendor:  
    67.     VRAM:     4197 MB
    68.     Driver:   25.20.100.6323
    69. Begin MonoManager ReloadAssembly
    70. - Completed reload, in  2.661 seconds
    71. <RI> Initializing input.
    72. <RI> Input initialized.
    73. <RI> Initialized touch support.
    74. WARNING: Shader Unsupported: 'Standard' - Pass 'META' has no vertex shader
    75. WARNING: Shader Unsupported: 'Standard' - Pass 'META' has no vertex shader
    76. WARNING: Shader Unsupported: 'Standard (Specular setup)' - Pass 'META' has no vertex shader
    77. WARNING: Shader Unsupported: 'Standard (Specular setup)' - Pass 'META' has no vertex shader
    78. UnloadTime: 28.316600 ms
    79. LoadLastSave
    80. UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    81. UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    82. UnityEngine.Logger:Log(LogType, Object)
    83. UnityEngine.Debug:Log(Object)
    84. company.SaveManager:LoadLastSave() (at C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:317)
    85. company.AssetManager:Load() (at C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Assets\AssetManager.cs:47)
    86. company.SaveManager:Load() (at C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:61)
    87. company.SaveManager:Awake() (at C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:44)
    88. (Filename: C:/Users/Username/Documents/companyappli/Assets/company/Scripts/Source/Versions/SaveManager.cs Line: 317)
    89. DirectoryNotFoundException: Directory 'C:/Users/kouellet/Documents/company/testapp/package_Data\../Data\Saves' not found.
    90.   at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x000f7] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:514
    91.   at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:308
    92.   at company.SaveManager.SaveFilesInfo () [0x0000c] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:210
    93.   at company.SaveManager.get_GetLastSavePath () [0x00002] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:311
    94.   at company.SaveManager.LoadLastSave () [0x0000c] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:318
    95.   at company.AssetManager.Load () [0x0006d] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Assets\AssetManager.cs:47
    96.   at company.SaveManager.Load () [0x00016] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:61
    97.   at company.SaveManager.Awake () [0x0001e] in C:\Users\Username\Documents\companyappli\Assets\company\Scripts\Source\Versions\SaveManager.cs:44
    98. (Filename: /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs Line: 514)
    99. WARNING: Shader Unsupported: 'Legacy Shaders/Diffuse' - Pass 'Meta'##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1555358994155,"processId":19988,"allocatedMemory":12772,"memoryLabels":[{"Default":1048},{"NewDelete":368},{"Thread":8},{"Manager":320},{"VertexData":576},{"GfxDevice":8000},{"Physics":32},{"Serialization":40},{"Terrain":88},{"String":784},{"DynamicArray":756},{"PoolAlloc":-88},{"Sprites":16},{"VR":536},{"SceneManager":280},{"Secure":8}]}
    100. Setting up 4 worker threads for Enlighten.
    101.   Thread -> id: 17c -> priority: 1
    102.   Thread -> id: 834 -> priority: 1
    103.   Thread -> id: 4d8 -> priority: 1
    104.   Thread -> id: 27c4 -> priority: 1
    105. ##utp:{"type":"MemoryLeaks","version":2,"phase":"Immediate","time":1555359033031,"processId":10292,"allocatedMemory":13445,"memoryLabels":[{"Default":1048},{"NewDelete":368},{"Thread":8},{"Manager":320},{"VertexData":768},{"GfxDevice":8160},{"Physics":32},{"Serialization":40},{"Terrain":88},{"String":817},{"DynamicArray":1044},{"PoolAlloc":-88},{"Sprites":16},{"VR":536},{"SceneManager":280},{"Secure":8}]}
    106.  
    107.  
    Here's an additionnal log. I runned the build on another CG and got the exact same issue. Do you have any idea ? Am I using correctly the API ?
     
  32. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Reach out to Unity. It's failing to create RenderTextures from what I can tell. I haven't seen anything similar.
     
  33. edee1337

    edee1337

    Joined:
    Apr 10, 2013
    Posts:
    34
    How's progress on this, any ETA? Thank you! :)
     
  34. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Trying to get Android working, because AsyncGPUReadback isn't supported on OpenGL (ES)
     
    edee1337 likes this.
  35. MaximilianHoglund

    MaximilianHoglund

    Joined:
    Mar 30, 2017
    Posts:
    3
    Hi!
    I recently started working with NatCorder, and I ran into an issue when trying to run the ReplayCam example scene unmodified. The outputted video files end up 32 bytes in size, not containing any information about the video. I'm running on Windows. Any idea why the included example doesn't behave properly?
     
  36. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Do you have the microphone recording option enabled? If so, put it off and tell me if this issue persists. I'm looking into it.
     
  37. MaximilianHoglund

    MaximilianHoglund

    Joined:
    Mar 30, 2017
    Posts:
    3
    If I turn on microphone recording, then OnReplay isn't called, but there is still a video file created at 32 bytes. If it is turned off, OnReplay is called, but the saved recording is still at 32 bytes.

    Update: Ran this on a Mac, and the issue does not manifest. It appears this is a Windows-specific issue. I am running windows 7 in case this is relevant.
     
    Last edited: Apr 17, 2019
  38. poprev-3d

    poprev-3d

    Joined:
    Apr 12, 2019
    Posts:
    71
    I finally found the origin of the memory leak, it's the conjoint use of the Outline Effect Asset (https://github.com/cakeslice/Outline-Effect) and of NatCorder. I emailed you about it :)
     
    Lanre likes this.
  39. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Ah the crucial detail is your version of Windows. NatCorder requires Windows 8 (and in the next update, it will require Windows 10 64-bit).
     
  40. MaximilianHoglund

    MaximilianHoglund

    Joined:
    Mar 30, 2017
    Posts:
    3
    I see! Thanks!
     
    Lanre likes this.
  41. seneka123

    seneka123

    Joined:
    Jun 16, 2013
    Posts:
    30
    Hello! I use the NatShare plugin to transfer the saved video from the internal folder of the application to the gallery folder. But when you call NatShare.SaveToCameraRoll (path);
    gives an error that the file was not found along this path. The path itself is taken from the NatCorderiOS script. The error looks like this:
    File not found at file:///var/mobile/Containers/Data/Application/F3D5204B-1EF4-4EBD-A6CC-51C46894E765/Documents/recording_2019_04_20_14_41_17_628.mov

    Help me please!
     
  42. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    You need to update to the latest version of NatCorder. NatShare will usually not work properly with an older version of NatCorder.
     
  43. seneka123

    seneka123

    Joined:
    Jun 16, 2013
    Posts:
    30
    Hello! I installed the latest version of NatCorder, I had to change part of the code, after changing to

    cameraTexture = new WebCamTexture();
    cameraTexture.Play();
    // Create a clock for generating recording timestamps
    recordingClock = new RealtimeClock();
    // Create a recorder
    mediaRecorder = new MP4Recorder(recordingWidth, recordingHeight, 30, 44100, 1, OnReplay);
    StartCoroutine(RecordLoop());

    In the video, only what the physical camera sees is saved, but I need to record video from the game camera because I use Vuforia in the application
     
  44. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Check the README.md for information on how to record from a game camera (specifically, the notes on CameraInput). You can also check the ReplayCam example for guidance.
     
  45. seneka123

    seneka123

    Joined:
    Jun 16, 2013
    Posts:
    30
    Is there any way to increase the volume of the recorded sound from the microphone?
     
  46. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    Unity's Microphone class does not provide any way to do this.
     
  47. kgy7585

    kgy7585

    Joined:
    Mar 27, 2019
    Posts:
    1
    hello i want to record my game. i imported natcorder , but it is so diffcult can i help? i just want to record my game thx
     
  48. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,970
    You'll need to be more specific than this. To use NatCorder, you will have to write some code to actually record your game. You can follow the README and the included example code.
     
  49. seneka123

    seneka123

    Joined:
    Jun 16, 2013
    Posts:
    30
    And me again!) In my application, I use Vuforia for AR, if you record video from the main camera, everything works great, but as soon as I switch to the front camera, everything appears correctly on the screen, but in the video recording all the normals of the geometry are turned inside out, How to fix it?
    P.S. Sorry for my English!
     
  50. Shane-Pangea

    Shane-Pangea

    Joined:
    Dec 12, 2012
    Posts:
    38
    Is there a way that I can add additional audio to the recorded video after the video has been recorded?