Search Unity

NatCorder - Video Recording API

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

  1. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    I'm using 1.2 from the asset store. I deleted NatCorder before I imported it. I have the Transform shader, but no AspectFitter shader in that folder, or anywhere in my project.

    The outfor from Config/framerate

    Configuration: { 960x640 @60Hz 5771.249kbps 3I } - Target Framerate: 60
     
  2. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    That's very very weird. I'll look into this.
     
  3. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    Would you be able to share the AspectFitter shader on PM? I can test to ensure it works right with it included. I've just commented all that out for the time being, and used the basic Graphics.blit()
     
  4. buckUnity

    buckUnity

    Joined:
    Apr 23, 2018
    Posts:
    10
    In the asset store it does confirm that it is 1.2f1, but when I import in the plugin nothing gets updated except the example scenes. When I did a clean import, the change log in the plugin still indicates that it is version 1.1

    EDIT: It was indeed Unity's server being the perpetrator. The 'New' Asset store UI layout updates to 1.1. When I reverted it back to the old asset store UI layout it updated to 1.2
     
    Last edited: Apr 24, 2018
  5. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Sure. I'll send it over now.
     
  6. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    This is good to know. I'm not too sure what Unity is doing with two separate Asset Store websites.
     
  7. muldercnc

    muldercnc

    Joined:
    Jun 22, 2013
    Posts:
    15
    I purchased NatCam and am trying to generate a preview a few seconds into the recording. On ios the preview is scrambled as in the attached photo (inset image). On android it seems to work fine.
     

    Attached Files:

  8. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Can you delete NatCorder from your project and reimport it from the Asset Store? We fixed this in a silent update.
     
  9. muldercnc

    muldercnc

    Joined:
    Jun 22, 2013
    Posts:
    15
    Hi thanks - I deleted NatCorder and re-downloaded but still produces the same result; scrambled texture on IOS for the preview. Is there anything else i should try?
     
  10. ZikW

    ZikW

    Joined:
    Aug 18, 2014
    Posts:
    18
    Hi Lanre,

    There's some weird flickering when recording on iOS with Vuforia using ARKit. I think the issue was introduced in your last update.

    Everything works really well on Android.

    Unity 2018.1.0b13
    XCode 9.2
    iOS 11.3

    Thanks and keep up the good work!
     
    Last edited: Apr 28, 2018
  11. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Send me an email with a zip of your NatCorder folder. I have been having reports of Unity not actually updating the package that gets imported to Unity, and I believe it is the same here because we fixed this issue.
     
  12. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Yes, this issue was introduced in the latest version. We pushed a silent update that fixes it. Try deleting and reimporting NatCorder from the Asset Store. If that doesn't work, then email me and I'll troubleshoot.
     
  13. ZikW

    ZikW

    Joined:
    Aug 18, 2014
    Posts:
    18
    Still doesn't work. I sent you an email with the NatCorder folder.

    Thanks.
     
  14. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Seen and responded.
     
  15. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    I'm having issues with consistently recording the in-game audio. I'm calling StartRecording and passing in the AudioListener. And the first time it records audio, but then after that it stops and all videos after have no audio.

    Code (CSharp):
    1.  
    2. Replay.StartRecording(CameraRef, Configuration.Screen, OnRecordingComplete, AudioListenerRef);
    3.  
    Unity 2017.3.1f1
    NatCorder 1.2
    iOS 11+
    ARKit
     
  16. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    I'm also doing an ARKit app and I saw your post. I've been using 1.2 for a week, but wanted to fix any flickering issues. So, I grabbed the latest from the Asset Store and now my videos are somehow flipped vertically. I'm reverting changes.
     
  17. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Can you email me one of the videos that don't have sound? I need to analyse the video.
    Try reimporting once again. We pushed a silent update fixing the inversion issue.
     
  18. buckUnity

    buckUnity

    Joined:
    Apr 23, 2018
    Posts:
    10
    Quick question about the Replay class. Are we responsible for deleting the temp file that is generated from the recording or is that automatically done?
     
  19. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    The recorded video is not a temp file. It is saved to the app's private documents directory.
     
  20. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    I emailed you some sample videos.
    I grabbed the latest and the flipped video is fixed. thanks!

    UPDATE: For sanity's sake, I made a test scene with nothing but recording a video with scene audio. And I can confirm that outside of my project, it still only records audio on the first recording.
     
    Last edited: May 2, 2018
  21. magglemitch

    magglemitch

    Joined:
    Dec 8, 2013
    Posts:
    112
    Hi - bought the plugin the other day and it is working great.

    Only thing messing up is taking a thumbnail on an iOS device? On Android and I can capture it find and assign it to a RawImage for display. On iOS however, the image comes out weird and skewed. Is there a proper way to take a thumbnail image from the recorded video and assign to an image on iOS?

    Thanks
     
  22. muldercnc

    muldercnc

    Joined:
    Jun 22, 2013
    Posts:
    15
    Hi I sent an email with my NatCorder folder. Thanks
     
    Lanre likes this.
  23. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    What device and platform are you recording on? Chances are that this bug is not in the native implementation, but somewhere in our Unity setup. I confirmed that the videos you sent me have audio tracks, the second one just happens to be silent. Can you share your setup code?

    You should be able to reproduce this while recording in the Editor. When recording, click on the gameobject that has the AudioSource or AudioListener you are recording from. There should be an 'Audio Recorder' script with a VU meter visible. The VU meter indicates how much sound is coming through the component. If it stays flat, then no sound is going through it.

    Can you send me a repro?
     
  24. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Are you using our NatShare API? If not, then please upgrade your version of NatCorder to 1.2 and get NatShare. Please post any sharing-related issue on the NatShare forum thread.
     
  25. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    I'm not sure I got it. Ty upgrading once more. If that doesn't fix it, then email me and I will send you the native libs directly.
     
  26. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    I'm working on a Mac 10.13.3 with Unity 2017.3.1f1 and building for iOS 11+. Also, this is happening both in the Editor and on device.

    I sent you a test scene. The first time recording, the Audio Recorder on the AudioListener is green and the video has audio. The second time, the Audio Recorder has nothing, but I still hear the scene audio and the video is silent.
     
    Last edited: May 2, 2018
  27. muldercnc

    muldercnc

    Joined:
    Jun 22, 2013
    Posts:
    15
    New
    I have tried updating again repeatedly - please send me the native libs. Have emailed again, please let me know if you don't get it.
     
    Lanre likes this.
  28. muldercnc

    muldercnc

    Joined:
    Jun 22, 2013
    Posts:
    15
    How can I tell if i have the latest? Is there a version number somewhere that i can check?
     
  29. muldercnc

    muldercnc

    Joined:
    Jun 22, 2013
    Posts:
    15
    Sorry to push - but I really need to fix this problem. Have an application that must be published today and has tearing in the recorded videos. Really appreciate your work, but need a response. I am not sure you are receiving my emails. Can you please email me the updated binaries?
     
    Last edited: May 2, 2018
  30. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    I believe it says the version in the Debug log when you call StartRecording.
     
  31. muldercnc

    muldercnc

    Joined:
    Jun 22, 2013
    Posts:
    15
    NatCorder: Initialized NatCorder 1.2 macOS backend
    NatCorder: Initialized NatCorder 1.2 macOS backend

    Does this mean i do not have the latest? Should be 1.2f1 right?
     
  32. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    NatCorder/Changelog has the version as well.
     
    Lanre likes this.
  33. muldercnc

    muldercnc

    Joined:
    Jun 22, 2013
    Posts:
    15
    Ok My Problem appears to be with Metal. I was running with build settings set to "auto graphics api". When running Metal the video recording is super glitchy on IOS 11.3

    Limiting to OpenGLES2.0 seems to have sorted my problem

    Still would like to know if I have the latest bleeding edge NatCorder though?
     
  34. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    FYI - The latest NatCorder 1.2 update contains binaries built with Xcode 9.3. Unity Cloud does not yet support Xcode 9.3 (soon™), so my cloud builds are failing with:

    Code (CSharp):
    1. 490:;  ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '902.0.39.1_0' Reader: '900.0.39.2_0')', using libLTO version 'LLVM version 9.0.0, (clang-900.0.39.2)' for architecture arm64
    2. 491:;  clang: error: linker command failed with exit code 1 (use -v to see invocation)
    3. 492: ▸ clang: error: linker command failed with exit code 1 (use -v to see invocation)
    4. 493: fastlane finished with errors
    5. 494: /BUILD_PATH/.mason/buildpacks/xcode/bin/compile:253:in `block in build': ! xcode build failed. (RuntimeError)
    Which means I have can't have iOS bitcode enabled. No big deal for now, disabling it allows me to make cloud builds, just thought you should know.

    UPDATE: UCB now supports Xcode 9.3
     
    Last edited: May 7, 2018
  35. buckUnity

    buckUnity

    Joined:
    Apr 23, 2018
    Posts:
    10
    I'm getting a weird flickering on iOS ARKit. I've tried deleting the the Natcorder plugin and reimporting it through the asset store but the results are the same.
    I'm on Xcode 9.3, Unity 2018.1.0f2, iOS 11.3.1, and Natcorder 1.2f1
     
    Last edited: May 3, 2018
  36. Combustibles

    Combustibles

    Joined:
    May 3, 2018
    Posts:
    6
    Hi there, I've been using the API to create a presentation recorder desktop app and I have 2 problems.
    #1: When the project is running and when i record and stop recording the video, the video file is saved in the project file. When its the build version, the video file is nowhere to be found. I'd like to be able to set where the video will be saved.

    2# When recording the video, its audio is very unclear, lags and is overall not usable. I'd like to have clear and listenable audio.

    I'm not the best coder and any help towards these issues is much appreciated. Thank you.
     
  37. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Thanks for sending me a repro. This was an issue with your setup. You had both an AudioListener (from which game audio was being recorded) and an AudioSource (which you were using for video playback) on the scene camera. This results in undefined behaviour for MonoBehaviour's OnAudioFilterRead function. It wouldn't know whether to stream audio from the audio source or audio listener.
     
    dustin_red likes this.
  38. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Just as a follow up, the tearing on Metal has been fixed. We will be pushing another update later today.
     
  39. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Apparently, downloading NatCorder from the 'My Downloads' page will allow you get the latest version. And yes, the tearing is specific to Metal but as I've mentioned, it has been fixed and we will post the update soon.
     
  40. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Can you email me a video showing the flickering? I want to confirm that it isn't the other issue that we have fixed.
     
  41. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    This is good to know. Thanks for bringing it to my attention.
     
  42. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    That was it! It’s always something simple. Thank you so much for all your hard work and responsiveness on this plugin.
     
    Lanre likes this.
  43. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    NatCorder will save videos to the app's private documents directory. If you would like to place the video somewhere else, then use the System.IO.File.Move function to move it in the video callback. The path to the video is always provided in the VideoCallback.
    What platform are your recording on? If you are on Windows, then make sure you have updated to NatCorder 1.2f1 because we fixed this issue in that version.
     
  44. dustin_red

    dustin_red

    Joined:
    Feb 7, 2018
    Posts:
    46
    Any news on the Metal update? Thanks.
     
  45. Combustibles

    Combustibles

    Joined:
    May 3, 2018
    Posts:
    6
    Hi, thanks for responding quickly to my questions. Should I use the System.IO.File.Move function in the Greyworld script, NatCoderTypes script or the VideoCallback html script?
     
  46. Combustibles

    Combustibles

    Joined:
    May 3, 2018
    Posts:
    6
    Actually, I've solved the file moving issue, I used this to change the path.
    Code (CSharp):
    1. void OnVideo (string path) {
    2.             string[] temp = path.Split('/');
    3.             string newPath = temp[0] + "\\" + temp[1];
    4.             Debug.Log(newPath);
    5.             Debug.Log(Application.dataPath + "/StreamingAssets/SavedVideos/" + temp[1]);
    6.             System.IO.File.Move(newPath, (Application.dataPath + "/StreamingAssets/SavedVideos/" +temp[1]));
    7.             Debug.Log("Saved recording to: " +newPath);
    8.             #if UNITY_IOS || UNITY_ANDROID
    9.             // Playback the video
    10.             Handheld.PlayFullScreenMovie(path);
    11.             #endif
    12.         }
    But right now the build itself still doesn't show the video. In the development build for Unity, it shows "UnauthorizedAccessException: Access to the path is denied."
     
    Last edited: May 4, 2018
  47. Combustibles

    Combustibles

    Joined:
    May 3, 2018
    Posts:
    6
    I've tried another way but with the same results.
    Code (CSharp):
    1.        void OnVideo(string path)
    2.         {
    3.             string[] temp = path.Split('/');
    4.             //Debug.LogError(path);
    5.             //Debug.LogError();
    6.             //Debug.Log(Application.persistentDataPath + "/StreamingAssets/SavedVideos/" + temp[1]);
    7.             System.IO.Directory.CreateDirectory((System.IO.Path.GetFullPath(".") + "/Exports/" + temp[temp.Length-1]));
    8.             new WaitForSeconds(5f);
    9.             System.IO.File.Move(path, System.IO.Path.GetDirectoryName((System.IO.Path.GetFullPath(".") + "/Exports/" + temp[temp.Length - 1])));
    10.             Debug.LogError(path);
    11.             Debug.Log("Saved recording to: " + path);
    12.             #if UNITY_IOS || UNITY_ANDROID
    13.             // Playback the video
    14.             Handheld.PlayFullScreenMovie(path);
    15.             #endif
    The video itself doesnt seem to want to change path. And if i use the .exe build on another computer it doesnt even save since it doesnt have the appdata to save into. I could really use some help with this.
     
  48. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Unity takes a few days to approve submissions. I will let you know when it's up.
     
  49. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    You want to do this in the VideoCallback (OnReplay/OnVideo). Never modify NatCorder sources.
     
  50. henriqueranj

    henriqueranj

    Joined:
    Feb 18, 2016
    Posts:
    177
    Hello @Lanre ,

    After updating to NatCorder 1.2f1 we noticed quite a framerate lag (~15FPS) while recording in the Samsung Galaxy Note 10.1 (2014) tablet with Android 5.0. With the previous version 1.1f1 it recorded with a stable 30FPS.

    As currently I don't have the time to dig deeper into profiling with the previous NatCorder version, are you aware of why this would happen with version 1.2f1? Maybe something with OpenGLES2?