Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

NatCorder - Video Recording API

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

  1. sd-Baek

    sd-Baek

    Joined:
    Jul 25, 2013
    Posts:
    2
    Code (CSharp):
    1. private void StartRecording()
    2.     {
    3.         Replay.StartRecording(Camera.main, Configuration.Screen, OnStopRecording, Camera.main.GetComponent<AudioListener>());
    4.  
    5.         recordingButton.GetComponentInChildren<Text>().text = "Recording";
    6.         StartRecordingOutsideSound();
    7.     }
    8.  
    9.     private void StopRecording()
    10.     {
    11.         Replay.StopRecording();
    12.  
    13.         recordingButton.GetComponentInChildren<Text>().text = "Video\nCapture";
    14.         outsideSoundRecordButton.gameObject.SetActive(false);
    15.         StopRecordingOutsideSound();
    16.     }
    17.  
    18.     private void StartRecordingOutsideSound()
    19.     {
    20.         if (currentOutsideSound == null)
    21.         {
    22.             outsideSoundRecordButton.gameObject.SetActive(true);
    23.             outsideSoundRecordButton.GetComponentInChildren<Text>().text = "Recording";
    24.  
    25.             currentOutsideSound = new GameObject("Microphone sound").AddComponent<AudioSource>();
    26.             currentOutsideSound.transform.position = Camera.main.transform.position;
    27.             currentOutsideSound.clip = Microphone.Start(microphoneDevice, true, 10, microphoneMaxFrequency);
    28.             currentOutsideSound.loop = true;
    29.             currentOutsideSound.outputAudioMixerGroup = Resources.Load<AudioMixerGroup>("Microphone");
    30.             while (!(Microphone.GetPosition(microphoneDevice) > 0)) { } //
    31.             currentOutsideSound.Play();
    32.             currentOutsideSound.gameObject.AddComponent<MicrophoneRecorder>();
    33.         }
    34.     }
    35.  
    36.     private void StopRecordingOutsideSound()
    37.     {
    38.         if (currentOutsideSound != null)
    39.         {
    40.             Microphone.End(null);
    41.             GameObject.Destroy(currentOutsideSound.gameObject);
    42.             currentOutsideSound = null;
    43.         }
    44.     }
    45.  
    46.     void OnStopRecording(string path)
    47.     {
    48.         captureProcessor.ProcessVideo(path);
    49.     }
    Yes. I'm recording with audio listener(for game sound) and microphone. and I'm not pausing the recording.
    On my code, I start/stop recording with "StartRecording" and "StopRecording" method.

    And for recording microphone with game sound. I use this code.
    Code (CSharp):
    1. void OnAudioFilterRead (float[] data, int channels) {
    2.                 // Calculate time
    3.                 var audioTime = Frame.CurrentTimestamp;
    4.                 if (!IsPaused) timestamp += lastTime > 0 ? audioTime - lastTime : 0;
    5.                 lastTime = audioTime;
    6.  
    7.                 // MIX Microphone sound. FIXME : Move this code to other place.
    8.                 if (MicrophoneRecorder.Instance != null && MicrophoneRecorder.data != null)
    9.                     data = AudioMixer.MixAndClampFloatBuffers(data, MicrophoneRecorder.data);
    10.  
    11.                 // Send to NatCorder for encoding
    12.                 if (!IsPaused) NatCorder.CommitSamples(data, timestamp);
    13.                 if (mute) Array.Clear(data, 0, data.Length);
    14.             }
    and AudioMixer class for mixing two sounds :
    Code (CSharp):
    1. public static class AudioMixer
    2. {
    3.     private static float ClampToValidRange(float value)
    4.     {
    5.         float min = -1.0f;
    6.         float max = 1.0f;
    7.         return (value < min) ? min : (value > max) ? max : value;
    8.     }
    9.  
    10.     public static float[] MixAndClampFloatBuffers(float[] bufferA, float[] bufferB)
    11.     {
    12.         int maxLength = Math.Min(bufferA.Length, bufferB.Length);
    13.         float[] mixedFloatArray = new float[maxLength];
    14.  
    15.         for (int i = 0; i < maxLength; i++)
    16.         {
    17.             mixedFloatArray[i] = ClampToValidRange((bufferA[i] + bufferB[i]) / 2);
    18.         }
    19.         return mixedFloatArray;
    20.     }
    21. }
     
  2. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Let's continue this over email. From all the info you've given me, you shouldn't be running out of memory while recording.
     
  3. niv_onehamsa

    niv_onehamsa

    Joined:
    Oct 30, 2016
    Posts:
    11
    Sorry for the delay I was travelling.
    I have now come back and found the cause of the issue.

    I was not being consistent when providing timestamps for audio samples or video frames. The audio time stamps were zero based (started at 0 and progressed according to time when recording was enabled) and the video timestamps I left to the default created on the Frame constructor (which I assume was the same as Frame.CurrentTimestamp).

    For some reason windows doesn't care much about that and still creates a valid video file while on iOS no audio is created.

    Anyway jrcharland if you are still having issues make sure the timestamps are consistent between audio/video. It seems to not matter whether they are zero based or absolute as long as the audio timestamps are same as the video.

    Cheers
     
  4. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Good observation. Some platforms rebase timestamps, so they actually only care about the difference in timestamps between the previous and current frame. If you are not manipulating timestamps, then I recommend using `Frame.CurrentTimestamp` for both audio and video frames.
     
  5. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Your code looks pretty good. Can you try recording with no audio (don't pass the audio listener to StartRecording) and let me know if you still get the second video to have an abnormally long length.
     
  6. Flag74

    Flag74

    Joined:
    May 31, 2017
    Posts:
    101
    Hi @Lanre, I installed a fresh windows10 copy on my pc, since u told me that minimum requisites was that, but still NatCorder crashes (this time randomly and less often).
    Unfortunately ur plugin is still unusable for me since I need to use it for a professional application on windows.
    You really need to address those stability issues.
     
  7. Rich0

    Rich0

    Joined:
    Aug 9, 2013
    Posts:
    43
    Hi,

    I'm having audio stutter issues on IOS 11.4 where the first video I record with microphone has choppy audio. However, if I record a second video directly after - no stuttering. Any ideas what could be causing this? I've enabled the "Prepare for recording" build setting, however this makes no difference.

    -R
     
  8. Rich0

    Rich0

    Joined:
    Aug 9, 2013
    Posts:
    43
    Ok... I found a fix - I just init the microphone, do the force to speaker fix & stop the audio source in the Start event.

    Code (CSharp):
    1. audioSource.clip = Microphone.Start(null, true, 60, 48000);
    2.             iPhoneSpeaker.ForceToSpeaker(); // fix to stop problems with the microphone being routed to the earpiece in unity. https://github.com/cbaltzer/UnitySpeakerFix
    3.             audioSource.Stop();
     
  9. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Can you send me logs? Overwhelming chances are that this crash is unrelated to the ones you faced previously.
     
  10. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Unity's Microphone API is unpredictable; it isn't suited for realtime recording. Unfortunately, there aren't other options available.
     
  11. Rich0

    Rich0

    Joined:
    Aug 9, 2013
    Posts:
    43
    I'm seeing the exact same issue using ARKIT on iOS. Frame rate drops after moving camera too sharply and in a few seconds it crashes with exactly the same error.

    https://issuetracker.unity3d.com/issues/metal-crashes-in-multithreaded-mode-when-changing-resolution mentions the same issue. It specifically says "It doesn't crash if you pass "-force-gfx-direct" arg."

    I'm under pressure for an app store submission and this is a show-stopper, does anyone have any idea how to pass the above arg to an iOS player? How do you practically implement the argument fix?
     
    Last edited: Jun 21, 2018
  12. Rich0

    Rich0

    Joined:
    Aug 9, 2013
    Posts:
    43
    .. UPDATE ..

    I've tried building with OPENGLES2 (the Unity ARKIT plug-in is broken under this right now - shows a green screen) - however it shows something interesting in the log (and it does not crash):

    OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command

    NatCamU.Dispatch.<Initialize>c__AnonStorey0:<>m__0()

    NatCamU.Dispatch.MainDispatch:Update()

    System.Action:Invoke()

    NatCamU.Dispatch.<OnFrame>c__Iterator0:MoveNext()

    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    I'm not sure what's happening here - but the problem happens when moving the phone quickly around in a low light environment. I suspect something similar is happening under Metal and it's not being caught properly. Any suggestions?

    ... SOLUTION ... (update)

    The issue was simply recording at 1080p is too much for the iPhone 7+ while running ARKIT. Reducing the recording resolution to 720p solved the issue.

    Request to developer:

    Is there any way of preventing the crash even if the resolution is too high?
     
    Last edited: Jun 21, 2018
  13. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    It is difficult to do this, because our code has no way to know what a device can handle and what it can't. And this also varies a lot per application, because applications that aren't as GPU-heavy tend to be able to record at higher resolutions/framerates.
     
  14. woowee

    woowee

    Joined:
    Jul 1, 2017
    Posts:
    9
    Hi there,
    I tried my AR app with NatCoder on iOS 12 beta, but it crashed in a few seconds after the recording started. On iOS 11 the same code works just fine. In Xcode log window I saw several lines of "applicationDidReceiveMemoryWarning". Please check that.
     
  15. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    NatCorder currently doesn't work on the iOS 12 beta. Apple seems to have broken something, causing a lot of errors.
     
  16. woowee

    woowee

    Joined:
    Jul 1, 2017
    Posts:
    9

    Unfortunately my new iPad 2018 with iOS 11.4 crashes too, just like iPhone 6s Plus with iOS 12 beta. Meanwhile, my iPhone 6s (iOS 11.4) works perfectly. That's quite strange. Or maybe the default resolution (1536*2048) is too high?
    Here's the XCode output:


    2018-06-24 17:07:04.819033+0800 marbles[602:101462] [Technique] World tracking performance is being affected by resource constraints [1]

    WARNING -> applicationDidReceiveMemoryWarning()

    2018-06-24 17:07:06.002262+0800 marbles[602:101462] [Technique] World tracking performance is being affected by resource constraints [1]

    Message from debugger: Terminated due to memory issue


    ==================================================================
    UPDATE: After I reduced the size of capture to 768x1024, it worked fine on iPad (iOS11.4). It even worked on iOS12 beta, no more crash,but with a heavy drop of game frame rate.
     
    Last edited: Jun 25, 2018
  17. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    This indicates that your app is very GPU-heavy. Regarding the framerate drop, is your app using Metal or OpenGL ES? Using Metal with multithreaded rendering significantly improves recording performance.
     
  18. unity_WZcjjPmfXipXXA

    unity_WZcjjPmfXipXXA

    Joined:
    Oct 13, 2017
    Posts:
    6
    Hello, I try to modify the bitrate and the framerate of video recorded with the class Configuration. But the values of bitrate and framerate are always different. Like if the screen diminute the quality. How do to have the best bitrate of the camera ?
     
  19. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    The hardware encoder will usually set a bitrate that it believes to be optimal. The bitrate setting passed in to the Configuration struct can simply be thought of as a suggestion. As for the video framerate, this actually depends on the spacing of the frame timestamps. Again, the framerate setting in the Configuration struct simply serves as a hint.
     
  20. unity_WZcjjPmfXipXXA

    unity_WZcjjPmfXipXXA

    Joined:
    Oct 13, 2017
    Posts:
    6
    Hello, ok thanks
     
    Lanre likes this.
  21. bgmulti15a

    bgmulti15a

    Joined:
    Feb 9, 2017
    Posts:
    21
    Hello, I'd like to develop a Unity app where the user can record a video from the device screen. The images displayed will be captured from the mobile device camera and I will apply some post processing filters on it. Can I do this with this asset? Will I be able to capture audio and decide where to save videos?

    My app will have on screen UI (buttons for recording etc) but I'd like them to not show up in the final video obviously. Can I do that?

    Thanks!
     
  22. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Yes. NatCorder is able to record textures.
    NatCorder allows you to provide audio data to be recorded, and it also provides helper methods to record Unity's audio (from an AudioSource or AudioListener).
    No, NatCorder will automatically record to the app's private documents directory. But you can always move the video to a desired path.
    Yes, you have complete control over what gets recorded.
     
  23. bgmulti15a

    bgmulti15a

    Joined:
    Feb 9, 2017
    Posts:
    21
    How can I achieve this?
     
  24. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    You can use the System.IO.File.Move function to move the recording from where it is (the path is provided by NatCorder) to where you want it to be.
     
  25. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    829
    Is there a way to make both vuforia and arkit work out of the box with Natcorder? It seems a pain to have to keep going back to each xcode file to fix things each time.
     
  26. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    829
    Is it possible to selectively focus on an area or point in the camera feed? The API docs for NatCam seem to have this - so I assume NatCorder also supports this?
     
  27. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    What things are you referring to?
    No, NatCorder is solely a video recorder, not a camera API. There is no such thing as focusing when it comes to NatCorder.
     
  28. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    829
    Tried an empty Unity 2018.1.2 (iOS build) project with Natcorder + Vuforia (from Unity's build settings "Vuforia enabled"). The app freezes after the first frame.
    Earlier in this thread, there were some directions on various .mm files to fix. Is there a more streamlined way than that?
     
  29. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Are you running one of NatCorder's examples. Because if so, the NatCorder examples use WebCamTexture which clashes with Vuforia's usage of the device camera (since the camera can only be accessed by one service at any given moment).
     
  30. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    829
    What's the current way you'd recommend to use Vuforia with NatCorder
     
  31. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Write code that uses either the Replay API or NatCorder API to start and stop recording. You can follow the included examples for how to record using either API.
     
  32. CarreraSilvio

    CarreraSilvio

    Joined:
    Jul 21, 2012
    Posts:
    23
    First of all great asset! Really easy to use. I have a question regarding it:

    1. Using NatCorder.StartRecording is there any way to specify the path the video is going to be saved?
     
    Lanre likes this.
  33. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    NatCorder doesn't expose a way to set the save path. If you would like the video to be somewhere specific, use the System.IO.File.Move function in the recording callback.
     
  34. CarreraSilvio

    CarreraSilvio

    Joined:
    Jul 21, 2012
    Posts:
    23
    Awesome. I ended up doing that before posting here but thought about asking here anyways. Thanks for the quick reply.
     
    Lanre likes this.
  35. tequibo

    tequibo

    Joined:
    Jun 4, 2013
    Posts:
    19
    I tried to use code for audio recording from official tutorial https://medium.com/@olokobayusuf/natcorder-tutorial-audio-workflows-1cfce15fb86a
    So I've put AudioGetter to camera with AudioListener component
    but I got this error
    Assets/AudioGetter.cs(28,42): error CS1503: Argument `#2' cannot convert `double' expression to type `long'

    Code (CSharp):
    1. //so I changed
    2. var timestamp = AudioSettings.dspTime;
    3. //to this
    4. var timestamp = (long)AudioSettings.dspTime;
    and now i got this error

    UnityException: Find can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
    NatCorderU.Core.Platforms.NatCorderWindows..ctor () (at Assets/NatCorder/Plugins/Managed/Platforms/NatCorderWindows.cs:21)
    NatCorderU.Core.NatCorder..cctor () (at Assets/NatCorder/Plugins/Managed/NatCorder.cs:107)
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for NatCorderU.Core.NatCorder
    AudioGetter.OnAudioFilterRead (System.Single[] samples, Int32 channels) (at Assets/AudioGetter.cs:28)

    Am I'm doing something wrong?

    I'm using Unity 2017.4.4f1
     
    Last edited: Jul 7, 2018
  36. rattlesnake

    rattlesnake

    Joined:
    Jul 18, 2013
    Posts:
    138
    The code below works better and doesn't provide any errors for me on Android/OnePlus 5:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. using NatCorderU.Core;
    6.  
    7. public class AudioGetter : MonoBehaviour, IAudioSource
    8. {
    9.     // Sample rate is simply Unity's audio sample rate
    10.     public int sampleRate { get { return AudioSettings.outputSampleRate; }}
    11.  
    12.     // Sample count is the number of audio samples per channel in one sample
    13.     // buffer that gets committed. This must equal `samples.Length / channels`
    14.     // from the `OnAudioFilterRead` function.
    15.     public int sampleCount {
    16.         get {
    17.             int buffLen, numBuffer;
    18.             AudioSettings.GetDSPBufferSize(out buffLen, out numBuffer);
    19.             return buffLen;
    20.         }
    21.     }
    22.  
    23.     // Channel count is the number of audio channels.
    24.     public int channelCount { get { return (int)AudioSettings.speakerMode; } }
    25.     public void Dispose() {
    26.         Debug.Log("Disposed, but not implemented");
    27.     }
    28.     private void OnAudioFilterRead(float[] samples, int channels) {
    29.         long timestamp = (long)(AudioSettings.dspTime * 1e+9f);
    30.         NatCorder.CommitSamples(samples, timestamp);
    31.         Debug.Log("tick");
    32.     }
    33. }
    However the sound doesn't record properly for me.

    I have this code for recording :
    Code (CSharp):
    1. public void StartRecording()
    2.     {
    3.         // Create a recording configuration
    4.         var configuration = new Configuration(cameraPreview.cameraTexture.width, cameraPreview.cameraTexture.height);
    5.         // Start recording with microphone audio
    6.         StartMicrophone();
    7.          // Get the `AudioGetter` component we created (now attached to an AudioSource or AudioListener)
    8.          AudioGetter audioGetter = audioSource.GetComponent<AudioGetter>();
    9.          NatCorder.StartRecording(configuration, callBackVideo, audioGetter);
    10.     }
    11.     private void StartMicrophone()
    12.     {
    13.         // If the clip has not been set, set it now
    14.         if (audioSource.clip == null)
    15.         {
    16.             audioSource.clip = Microphone.Start(null, true, 60, 48000);
    17.             while (Microphone.GetPosition(null) <= 0) ;
    18.         }
    19.         // Play through audio source
    20.         audioSource.timeSamples = Microphone.GetPosition(null);
    21.         audioSource.loop = true;
    22.         audioSource.Play();
    23.     }
    If StartMicrophone(); is removed then I have a video without any sound.

    But if I keep StartMicrophone(); then I have a sound on the video but with a terrible "Larsen Effect".

    The AudioSource component is the one by default, I just unchecked "Play on awake".

    Lanre could you help us ? :)
     
  37. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    829
    Actually, I meant to ask, how do you acquire the Vuforia frame for NatCorder to Blit? I tried the following code below, assuming StartRecording would record frames - but I believe that Blit is needed per Update?

    Is there an existing bare working Vuforia+NatCorder example?

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using NatCorderU.Core;
    5. using NatShareU;
    6. public class NatCorderTest : MonoBehaviour {
    7.  
    8.     public void StartRecording(){
    9.         var configuration = new Configuration(Screen.width, Screen.height);
    10.  
    11.         NatCorder.StartRecording(configuration,OnVideo);
    12.     }
    13.  
    14.     public void StopRecording() {
    15.         // Stop recording
    16.         NatCorder.StopRecording();
    17.     }
    18.  
    19.     public void Toggle(){
    20.         if (NatCorder.IsRecording)
    21.             StopRecording();
    22.         else
    23.             StartRecording();
    24.     }
    25.  
    26.     void OnVideo(string path) {
    27.         Debug.Log("Saved recording to: " + path);
    28.         NatShare.SaveToCameraRoll(path);
    29.         // Playback the video
    30. #if UNITY_IOS
    31.         Handheld.PlayFullScreenMovie("file://" + path);
    32. #elif UNITY_ANDROID
    33.             Handheld.PlayFullScreenMovie(path);
    34. #endif
    35.     }
    36.  
    37. }
    38.  
     
  38. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    You are supposed to create an AudioGetter and attach it to an AudioSource after calling NatCorder/Replay.StartRecording. This way, you are guaranteed that AudioGetter is only sending audio frames for recording once NatCorder has actually started recording.

    We are removing the IAudioSource infrastructure and replacing it with something much simpler and easier for developers to use. Hang tight!
     
  39. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    As I mentioned above, we are introducing a leaner way to record game audio (without having to worry about things like AudioGetter). More info coming very very soon.

    Regarding the Larsen effect, you might want to mute the AudioSource playing the mic audio (or manually clear the audio buffer in AudioGetter::OnAudioFilterRead after sending it to NatCorder).
     
    rattlesnake likes this.
  40. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    You can use the Replay API to record the Vuforia ARCamera. Something like this:
    Code (CSharp):
    1. Replay.StartRecording(arCamera, Configuration.Screen, OnRecording);
     
    ina likes this.
  41. TobiasW

    TobiasW

    Joined:
    Jun 18, 2011
    Posts:
    78
    Ugh. I have exactly the same problem with the same stacktrace. Sadly also on Windows 7. Is there a chance this could be fixed even though you don't officially support it?

    The saddest part for me is that it successfully exports the video and calls the onVideo callback, so apparently the core functionality works. And then my editor crashes :(
     
  42. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,292
    HI there,
    I'm just getting round to setting up audio stuff now, I'm not sure if I should hold off, since you are messing around with it. Just wondering though, would it be possible to get audio from the device microphone as well as the in game scene sounds?

    Thanks!
    Pete
     
  43. Zero-Lu

    Zero-Lu

    Joined:
    Dec 31, 2015
    Posts:
    12
    Dear Lanre,


    I am currently using NatCorder with ARCore. I can only get 10fps recorded video when there is no virtual objects in view and 5 fps when there is a virtual object in view.

    When NatCorder is not recording, the framerate is 30 fps and 20 fps for these two scenarios.


    The resolution is 720p. I need to hit 720p@30fps. Would really appreciate your help.
     
  44. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    Unfortunately I can't do this. In Windows 8, they made some changes to how the H.264 encoder is configured, which NatCorder uses. I'm surprised that the video is recorded successfully.
     
  45. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    We've added a really simple way to record game audio with microphone audio. The new version will be submitted in a day or two and I will be releasing an article tomorrow explaining all the changes.
     
    petey likes this.
  46. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,604
    What device are you recording on? Is your app using multithreaded rendering?
     
  47. tequibo

    tequibo

    Joined:
    Jun 4, 2013
    Posts:
    19
    Thanks!

    Thanks for quick reply!
    Adding component just before calling Replay function helped.
    Not sure how can I attach it after I called StartRecording, since I'm supposed to pass it as as an argument of said function.
    Looking forward to an easiest way to record sound.
     
  48. Zero-Lu

    Zero-Lu

    Joined:
    Dec 31, 2015
    Posts:
    12
    Hi Lanre, I am using Pixel XL. Right now ARCore doesn't support multithreaded rendering according to this(https://github.com/google-ar/arcore-unity-sdk/issues/141) :-(

    EDIT: I just tried to restart my ARCore project to assess the fps. I used the default ARCore HelloAR example project and add the NatCorder ReplayCam.cs(Only change is the resolution is set at 720p).

    After disabling MatchFrameRate(Suggested by Google), the fps is almost 20fps. With MatchFrameRate on, the fps is around 10fps. But the game view updates 60fps and 30fps for these two scenarios.

    Although I can still get 10fps and 5fps in my own project, I would still say I saw some light in the darkness. Now the question is how can I get 30fps@720p in the ARCore HelloAR example project.
     
    Last edited: Jul 10, 2018
  49. TobiasW

    TobiasW

    Joined:
    Jun 18, 2011
    Posts:
    78
    And the Windows 7 H.264 encoder isn't usable?

    (Although I I'm not sure that's the reason for the Unity editor crash, considering that the video always records fine and it always crashes seconds after successfully ending the recording and saving the video file.)

    Is the WebGL backend also not working on Windows 7? What does "experimental" mean?
     
  50. Zero-Lu

    Zero-Lu

    Joined:
    Dec 31, 2015
    Posts:
    12
    Hi Robson,

    I am trying to use NatCorder to record ARCore as well and so far the fps is low(5-10fps). Could you please tell me what api did you use to achieve it? Did you use Replay(High level API) or NatCorder (Low level API)?

    I posted more info in my posts before and you can check them out if you want.

    Any help is appreciated!
     
    Last edited: Jul 10, 2018