Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

NatCorder - Video Recording API

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

  1. hikariakio

    hikariakio

    Joined:
    Dec 19, 2016
    Posts:
    25
  2. schaffen

    schaffen

    Joined:
    Mar 6, 2013
    Posts:
    2
    Good to hear! this is what I really needed. Can I join in your Beta? I'll send PM to you :) Thanks
     
  3. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Can you email me the full logs from logcat? Thank you.
     
  4. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Hey all.

    Sorry for the silence over the past few days. We aren't sharing the beta anymore because we are just about to release the API on the Asset Store. I will be sure to post here when the API is live. Thank you for you interest!
     
    alexennerfelt and henriqueranj like this.
  5. peterahou

    peterahou

    Joined:
    May 19, 2015
    Posts:
    47
    Did you manage to fix the issues with glitches and stuttering? And does the result playback correctly in the Unity Video Player? It seemed to me like the beta version wasn't quite ready for release.
     
    henriqueranj likes this.
  6. pldominguez

    pldominguez

    Joined:
    May 23, 2017
    Posts:
    1
    Hey, nice work with this replacement for Everyplay! Could I still join as a beta tester? Thanks
     
    Lanre likes this.
  7. alexennerfelt

    alexennerfelt

    Joined:
    Jan 7, 2017
    Posts:
    3
    Awesome, will it be up within the week? I am bursting with anticipation :)
     
    Lanre likes this.
  8. Mr-Oliv

    Mr-Oliv

    Joined:
    Sep 14, 2012
    Posts:
    26
    Bump

    Hi! Thanks for putting together this asset!
    Just tried exporting the example project (the rotating cube), but the app freezes when I double tap. Is there something I need to do when exporting to make it work?
    I'm on a Google Pixel, latest Android.
    Thanks

    NullReferenceException: Object reference not set to an instance of an object: at NatCorderU.Core.Replay+CameraRecorder.OnRenderImage (UnityEngine.RenderTexture src, UnityEngine.RenderTexture dst) [0x00000] in <filename unknown>:0
    (Filename: Line: -1)
    NatCorder Error: Cannot acquire frame when NatCorder is not recording
     
  9. pjccccc

    pjccccc

    Joined:
    Oct 7, 2015
    Posts:
    43
    Is there any new version since 1.0b1?
     
  10. zhoujinhao2599

    zhoujinhao2599

    Joined:
    Oct 23, 2017
    Posts:
    2
  11. thomasglitchr

    thomasglitchr

    Joined:
    Mar 17, 2015
    Posts:
    9
    Hello, any idea of when this will be up on the asset store?
     
    Lanre likes this.
  12. calRoto

    calRoto

    Joined:
    Feb 19, 2014
    Posts:
    4
    I'd like to try the beta if possible. I'd be recording video from an external hardware camera, and audio from an external microphone.
     
  13. boorch

    boorch

    Joined:
    Oct 7, 2015
    Posts:
    33
    hi there! i want to record my gameplay, i'd like to try natcam if it works in-editor maybe?
     
  14. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Yes, we created a fix and verified that it worked. We have since been unable to reproduce the glitches.
     
    henriqueranj likes this.
  15. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    We fixed this issue. It had to do with managing the state of the `IsRecording` field.
     
    henriqueranj likes this.
  16. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Hi guys. Sorry for the radio silence over the past few days, and for the delay. Unity has yet to review the API so we are waiting for them. I am waiting for them to push it up. In the meantime, here is the API documentation.
     
    henriqueranj likes this.
  17. g3studio

    g3studio

    Joined:
    May 8, 2017
    Posts:
    1
  18. kksum

    kksum

    Joined:
    Nov 28, 2015
    Posts:
    1
    I found everyplay and NatCorder during the video encodings search.
    If you look at the document, it looks like NatCorder is more like what we wanted, so I want to test your API.
    alonox@naver.com
     
  19. Wijnand-van-Tol

    Wijnand-van-Tol

    Joined:
    Jun 22, 2013
    Posts:
    7
    Hi Lanre,

    I'm working together with @henriqueranj and following up on the suggested fix on how to combine NatCorder with Vuforia. My knowledge of objective C isnt that great unfortunately and I couldn't get it to work.

    The specific part I'm having trouble with is "In OnRenderDispatch, invoke VuforiaRenderEvent with passing in the eventID argument.". Is this the same as calling the function? Or is there something else I need to do?
    As of now it still crashes when I try to record when NatCorder is enabled.

    Sincerely,

    Wijnand
     
  20. Deleted User

    Deleted User

    Guest

  21. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Yes, simply call the function.
    Can you email me the full logs from Xcode, with a screenshot of the stack trace.
     
  22. tonidurans

    tonidurans

    Joined:
    Jan 30, 2015
    Posts:
    6
    Hi, I would love to try this plugin, I already use Natcam Pro
    Great work
     
  23. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    It should be out very soon. Unity is taking longer than usual to approve it.
     
  24. tonidurans

    tonidurans

    Joined:
    Jan 30, 2015
    Posts:
    6
    May I try the beta version, while waiting?
     
  25. AteoMarcel

    AteoMarcel

    Joined:
    Jan 5, 2017
    Posts:
    17
    We are using your great plugin in one of our apps. It works great on android, however, on IOS we have the problem, that the SaveCallback never is called.

    We get no error, we just never receive the callback.
    Is there any way to debug this?
     
  26. jordyhenry

    jordyhenry

    Joined:
    Oct 20, 2016
    Posts:
    3
    Hi, I already have NatCam Pro, and Im very interested to test this new Plugin, my email is jordy.hpereira@gmail.com
     
    Last edited: Feb 15, 2018
  27. ToniFuturefly

    ToniFuturefly

    Joined:
    Mar 8, 2017
    Posts:
    5
    Would love to join the beta testing program, have sent you email privately!

    -Toni @ Futurefly
     
  28. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Can you email me the logs from logcat? I'm not sure what could cause this.
     
  29. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Hi guys, I apologize for the delay. Unity has still not reviewed the API. We are waiting for them to approve it so that it can be available on the Asset Store. In the mean time, we are not giving out the beta since they should be releasing it very soon.
     
    henriqueranj and alejobrainz like this.
  30. NicoWakatoon

    NicoWakatoon

    Joined:
    Jul 30, 2015
    Posts:
    2
    Hi Lanre, what are the minimum Os Version for NatCorder?
     
  31. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    On Android, it is API level 18 (Android 4.3 Jellybean) and on iOS, it is iOS 7.
     
  32. thomasglitchr

    thomasglitchr

    Joined:
    Mar 17, 2015
    Posts:
    9
    Hello Lanre,

    We would like to use your plugin for a professional project. Any news about the Asset Store release?
     
  33. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Still not yet, Unity has yet to review the package.
     
  34. schaffen

    schaffen

    Joined:
    Mar 6, 2013
    Posts:
    2
    Congratulations!
    it seems that I am a first buyer on assetstore
    nice work and thank you!
     
  35. Yuuki-Mochiduki

    Yuuki-Mochiduki

    Joined:
    Nov 29, 2012
    Posts:
    11
    @Lanre Thank you for your great work!

    I purchased your asset and I'm testing it.

    On Android, when I use "Sharing.SaveToCameraRoll", I caught next error.

    AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='saveToCameraRoll' ...

    Can I fix this? Please teach me workaround.
     
  36. thomasglitchr

    thomasglitchr

    Joined:
    Mar 17, 2015
    Posts:
    9
    Hello @Lanre ,

    Finally the release is here, thank you for your hard work. But I can't get it to work on iOS in my Vuforia application. I tried to follow your instructions carefully by editing the render delegates, but it always crashes when I call Replay.StartRecording.

    Can you help me please ?
     
  37. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Thank you! You purchased it before I was even notified that the API was live.
     
  38. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Thanks for letting me know about this. I will update you with a fix in a few hours.
     
  39. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Hi there. We have modified NatCorder so that you don't need to modify the sources to work with Vuforia. Please email me with your invoice number and I will send you the updated build. We are uploading the update to the Asset Store today.
     
  40. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    250
    Hi Larne,

    Congratulations on releasing the plug in. Implementation was quick and easy, but I'm having difficulties replaying the preview into a raw image using a video player component instead of using the PlayFullScreenMovie. This is my code:

    Code (CSharp):
    1.     public void playPreview (string path){
    2.  
    3.         Debug.Log("Playing Preview: " + path);
    4.  
    5.         videoPlayer.EnableAudioTrack(0, true);
    6.         videoPlayer.SetTargetAudioSource(0, audioSource);
    7.  
    8.         videoPlayer.source = VideoSource.Url;
    9.         videoPlayer.url = path;
    10.  
    11.         videoPlayer.playOnAwake = true;
    12.         audioSource.playOnAwake = true;
    13.  
    14.         videoPlayer.Prepare ();
    15.         Debug.Log("Done Preparing Video Preview");
    16.  
    17.         image.texture = videoPlayer.texture;
    18.         videoPlayer.Play();
    19.         audioSource.Play();
    20.     }
    Any suggestions?
     
  41. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    250
    Done! I was not loading the video correctly into the raw texture (needed to wait for the video to prepare). If anyone is interested, here is the fixed code:

    Code (CSharp):
    1.     public IEnumerator startPreview (string path){
    2.         Debug.Log("Playing Preview: " + path);
    3.  
    4.         videoPlayer.source = VideoSource.Url;
    5.         videoPlayer.url = path;
    6.  
    7.         videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource;
    8.         videoPlayer.EnableAudioTrack(0, true);
    9.         videoPlayer.SetTargetAudioSource(0, audioSource);
    10.  
    11.         Debug.Log("Set Audio Track to : " + audioSource);
    12.  
    13.         videoPlayer.Prepare ();
    14.  
    15.         //Wait until Movie is prepared
    16.         WaitForSeconds waitTime = new WaitForSeconds(1);
    17.         while (!videoPlayer.isPrepared)
    18.         {
    19.             Debug.Log("Preparing Movie");
    20.             yield return waitTime;
    21.             break;
    22.         }
    23.  
    24.         Debug.Log("Done Preparing Movie");
    25.  
    26.         //Assign the Texture from Movie to RawImage to be displayed
    27.         image.texture = videoPlayer.texture;
    28.  
    29.  
    30.         //Resize Video Texture to Full Width
    31.         float aspectRatio = (float)videoPlayer.texture.width/(float)videoPlayer.texture.height;
    32.         Debug.Log (aspectRatio);
    33.         RectTransform _mParentRect = transform.parent.GetComponent<RectTransform>();
    34.         RectTransform _mRect = GetComponent<RectTransform>();
    35.         _mRect.sizeDelta = new Vector2 (_mParentRect.rect.width,_mParentRect.rect.width/aspectRatio);
    36.  
    37.         videoPlayer.Play();
    38.         audioSource.Play();
    39.     }
     
    ellieYJ and Lanre like this.
  42. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Hi @brainz, and sorry for the late response (it's been a very packed day for me). You are correct; VideoPlayer.Prepare has to complete before you go ahead to play the video. You can also replace the while block with this:
    Code (CSharp):
    1. yield return new WaitUntil(() => videoPlayer.isPrepared);
    You can also use an AspectRatioFitter on your RawImage instead of setting the sizeDelta.
     
  43. Deleted User

    Deleted User

    Guest

    Considering to replace from EveryPlay...
    I have some questions about NatCorder.
    1. Is it absolutely unusable in Unity 5.x? (It would be nice if it was available in Unity 5.x.)
    2. When using Vuforia, can I record both of 2D UI and AR camera?
    3. Is it possible to selectively record game sound and microphone input or mix them?
    4. What happens if I start record on Android device lower than API 18?
     
  44. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    250
    Hi Lanre, Video preview using VideoPlayer is working great now, and it allows me to have a custom UI on top of it to share, etc.

    Now I have an issue with the microphone. after a while (doing a few different captures or going to background and returning, microphone stutters. You hear a cracking noise. I used the same code as your example. Any pointers are appreciated.

    - Also, is there a wat to set the file name beforehand? It seems it always creates a new file persistent on the app storage and I'd like to record over a single file or be able to delete after sharing.

    - Is there a way to save to a mp4 file instead of a mov file when sharing on iOS? It seems mp4 container is more universally compatible than mov (and I think you're already using a mp4 codec, right)?
     
  45. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Hi there @YuuSeongJun. Here are inline answers:
    You can absolutely use Unity 5.x (technically, 5.2 and above). The API was simply submitted to the Asset Store with a newer version of Unity.
    You absolutely can. You just have to make sure that the 2D UI can be rendered to a RenderTexture. I say this because canvases in UI - Overlay mode cannot be rendered to texture (weird Unity issue/bug).
    Yes, it is. With NatCorder, you can record from an individual AudioSource or from the scene's AudioListener. You will have to handle mixing yourself if you aren't recording all audio in the scene (by using AudioListener).
    NatCorder requires API level 18 because it uses some Android API's that were introduced in that release. NatCorder will not run on older OS versions. In fact, when building from Unity, you will have to set the minimum API level to at least 18.
     
  46. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Does this occur on iOS or Android? What device are you running on? Please email me with this information so I can open a new issue.
     
  47. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    No, there isn't any way to set the file name. You can use the System.IO API's to delete the file when you are done with it.
    You can simply rename the .mov file to .mp4, because the video is created with the MP4 format. We have considered using the .mp4 format when creating the file from the get-go, but we have deferred making a decision on it until we implement a Windows backend for NatCorder (and see if we stick to .mp4, or allow different formats on different platforms).
     
  48. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    The fix has just been published to the Asset Store. So re-download NatCorder and you should be all set.
     
  49. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
    Hi Thomas. An update that removes the need for modifying the native sources has just been released to the Asset Store. So re-download NatCorder and you shouldn't face any more issues integrating NatCorder with Vuforia.
     
  50. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,391
unityunity