Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

NatCorder - Video Recording API

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

  1. CoolUnityGames

    CoolUnityGames

    Joined:
    Dec 19, 2017
    Posts:
    3
    Hello,
    gread addon you have, very simple, very powerful, but I've found a problem with android devices, if I try to record the audio I get this message:

    I/art: Thread[10,tid=2679,Native,Thread*=0x4c017a00,peer=0x12cf3660,"UnityMain"] recursive attempt to load library "/data/app/com.DefaultCompany.humanViewer-2/lib/arm/libNatCamRenderDispatch.so"


    this is the audio getter I'm using

    Code (CSharp):
    1. public class AudioGetter : MonoBehaviour, IAudioSource
    2. {
    3.  
    4.     public int sampleRate {
    5.         get {
    6.             return AudioSettings.outputSampleRate;
    7.         }
    8.     }
    9.     public int sampleCount {
    10.         get {
    11.             int buffLen, numBuffer;
    12.             AudioSettings.GetDSPBufferSize(out buffLen, out numBuffer);
    13.             return buffLen;
    14.         }
    15.     }
    16.     public int channelCount { get { return 1; } }
    17.  
    18.     public void Dispose() {
    19.         Debug.Log("Disposed, but not implemented");
    20.     }
    21.  
    22.     private void OnAudioFilterRead(float[] samples, int channels) {
    23.         var timestamp = AudioSettings.dspTime;
    24.         NatCorder.CommitSamples(samples, (long)(AudioSettings.dspTime * 1e+9f));
    25.     }
    26. }

    And, the weirdest part is, if I use

    NatCorder.StartRecording(Configuration.Screen, OnVideo, getter); // with AudioGetter getter = gameObject.AddComponent<AudioGetter>();

    I get the recursive load of the library, with this I have no problem, just there isn't any audio

    NatCorder.StartRecording(Configuration.Screen, OnVideo);


    Any suggestion?
     
  2. j_souhail

    j_souhail

    Joined:
    May 21, 2018
    Posts:
    4
    After the update, sharing on IOS is not working Anymore. Any Suggestion?
     
  3. j_souhail

    j_souhail

    Joined:
    May 21, 2018
    Posts:
    4
    I managed to fix it using this library on github: UnitySpeakerFix_IOS7
     
    Lanre likes this.
  4. HeavyArmoredMan

    HeavyArmoredMan

    Joined:
    Apr 9, 2017
    Posts:
    4
    Hi Lanre,

    What are the minimum Android and iOS versions required to run NatCorder?
     
    Last edited: Jun 6, 2018
  5. Flag74

    Flag74

    Joined:
    May 31, 2017
    Posts:
    59
    Hi @Lanre
    I need to change path and filename of the recorded stream.
    Can u expose those variables or tell me how to configure it?
    thx
     
  6. adarrigol

    adarrigol

    Joined:
    Dec 10, 2015
    Posts:
    4
    Hi,

    Unity editor crashes when I use the following:
    Replay.StopRecording();
    Does someone have the same problem? I record a video for 3 seconds. I tried 10 seconds too without success.

    I have the same problem an Android but on Android I get some logs at least:
    E/AndroidRuntime: FATAL EXCEPTION: NatCorder Video Encoding Thread
    Process: com.wbsf.Atlas, PID: 26780
    java.lang.Error: FATAL EXCEPTION [NatCorder Video Encoding Thread]
    Unity version : 2017.4.1f1
    Device model : samsung SM-G930W8
    Device fingerprint: samsung/heroltebmc/heroltebmc:7.0/NRD90M/G930W8VLU2BQH1:user/release-keys

    Caused by: java.lang.IllegalStateException: Can't stop due to wrong state.
    at android.media.MediaMuxer.stop(MediaMuxer.java:274)
    at com.yusufolokoba.natcorder.Recorder.finishEncoder(Recorder.java:74)
    at com.yusufolokoba.natcorder.Encoder.run(Encoder.java:117)
    at java.lang.Thread.run(Thread.java:762)

    EDIT: can this be the problem:
    https://stackoverflow.com/questions...king-ends-with-illegalstateexception-cant-sto

    Thank you
     
    Last edited: Jun 5, 2018
  7. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    I mentioned this in the README.md file. Good thing you found it.
     
  8. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    "I" tags are simply verbose logging tags. They are completely innocuous. It's "E" and "F" tags that are error or crash messages.
     
  9. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Make sure you update to the latest version of NatShare (we updated them at the same time).
     
  10. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Here's the minimum required versions list:
    - iOS 7 on iOS
    - API level 18 on Android
    - Windows 8 on Windows
    - macOS 10.13 on macOS
    - Chrome 47, Firefox 25 on WebGL
     
    HeavyArmoredMan likes this.
  11. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    We are not exposing a way to set these parameters. You can use System.IO.File.Move to rename or move the file to your desired destination.
     
  12. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Can you email me the full logs from logcat as a .txt file? Send me the logs from app start to crash. As for the editor crash, are you running on Windows or macOS? You can access the crash logs from the crash report. Send it to me.
     
  13. CoolUnityGames

    CoolUnityGames

    Joined:
    Dec 19, 2017
    Posts:
    3

    06-06 15:09:22.443 29452-30485/com.igoodi.humanViewer E/Unity: AndroidJavaException: java.nio.BufferOverflowException
    java.nio.BufferOverflowException
    at java.nio.DirectByteBuffer.putShort(DirectByteBuffer.java:531)
    at com.yusufolokoba.natcorder.AudioEncoder.encodeSamples(AudioEncoder.java:60)
    at com.yusufolokoba.natcorder.NatCorder.encodeSamples(NatCorder.java:82)
    at org.fmod.FMODAudioDevice.fmodProcess(Native Method)
    at org.fmod.FMODAudioDevice.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:818)
    at UnityEngine.AndroidJNISafe.CheckException () [0x0008c] in /Users/builduser/buildslave/unity/build/Runtime/Export/AndroidJNISafe.cs:24
    at UnityEngine.AndroidJNISafe.CallVoidMethod (IntPtr obj, IntPtr methodID, UnityEngine.jvalue[] args) [0x00011] in /Users/builduser/buildslave/unity/build/Runtime/Export/AndroidJNISafe.cs:357
    at UnityEngine.AndroidJavaObject._Call (System.String methodName, System.Object[] args) [0x00038] in /Users/builduser/buildslave/unity/build/Runtime/Export/AndroidJavaImpl.cs:254
    at UnityEngine.AndroidJavaObject.Call (System.Str


    This could help? (Btw, I'm on a Galaxy S5 mini, android 5.1)
     
  14. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    This is a different error. Check your channel count in your AudioGetter script. Unity is probably giving you stereo audio, so the channel count should be 2. To confirm, open Audio Settings and see if the speaker mode is mono or stereo.
     
  15. ThreespinThree

    ThreespinThree

    Joined:
    May 30, 2018
    Posts:
    1
    As a follow up to this issue solved in 1.2f2:

    We can reproduce the same issue on a mac.

    Hope this crashlog will help you fix it.

     
  16. CoolUnityGames

    CoolUnityGames

    Joined:
    Dec 19, 2017
    Posts:
    3
    [Fixed]

    Ok, I found the problem, I copied the audio workflow on medium.com and the number of channels was hardcoded

    I had to use this:

    Code (CSharp):
    1. int IAudioSource.channelCount { get { return (int)AudioSettings.speakerMode; } }
    instead of this:

    Code (CSharp):
    1. int IAudioSource.channelCount { get { return 1; } }
     
    Lanre likes this.
  17. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    I will look into this. But ideally, you should commit at least one frame before stopping recording.
     
  18. Pancar

    Pancar

    Joined:
    Mar 11, 2013
    Posts:
    11
    Hi,

    can i record multiple texture at same time ? and can i use only webcam texture ?
     
  19. bad-bird

    bad-bird

    Joined:
    Feb 28, 2018
    Posts:
    3
    Thank you for your great work
    i have an issue when using natcorder on ios
    after the latest update i was not able to access the front facing cam
    here is my code:

    WebCamDevice[] devices = WebCamTexture.devices;
    int cameraIndex = 0;
    foreach(WebCamDevice cam in devices)
    {
    if(cam.isFrontFacing )
    {
    cameraTexture = new WebCamTexture(cameraIndex, Screen.width, Screen.height);
    cameraTexture.deviceName = cam.name;
    }
    cameraIndex++;
    }

    cameraTexture.Play();
     
  20. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    You can record as many textures as you want by blitting or rendering them to the encoder frame. But you record more than one video at a given time. NatCorder is not limited to recording WebCamTextures. It can record anything that is a texture or can be rendered to a texture.
     
  21. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Your code looks okay, but there is no way that NatCorder causes WebCamTexture to not find a camera (NatCorder does absolutely nothing with the device cameras). Look on Unity answers or forums for any clues.
     
  22. bad-bird

    bad-bird

    Joined:
    Feb 28, 2018
    Posts:
    3
    thank you
    i guess you are right
    actually the issue is happening on ios only
    on android its accessing the front facing cam
    but on ios it opens the back cam
    again thanks for your quick response
     
    Lanre likes this.
  23. nuruddin_a7

    nuruddin_a7

    Joined:
    Jun 30, 2017
    Posts:
    1
    not working with multiple cameras.
     
  24. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Can you be more descriptive? How is it not working? What is your setup? Can you share your code?
     
  25. kevinpaulharper_unity

    kevinpaulharper_unity

    Joined:
    Mar 8, 2018
    Posts:
    4
    Hey, I just downloaded the package and testing it out in my app. Every-time I start a recording the app crashes and complaints about Memory. Any ideas here?
    Code (CSharp):
    1. RecordingControllerClass:Record()
    2. UnityEngine.Events.UnityEvent:Invoke()
    3. UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
    4. UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
    5. UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
    6. UnityEngine.EventSystems.StandaloneInputModule:Process()
    7. (Filename: /Users/builduser/buildslave/unity/build/Runtime/Export/Debug.bindings.h Line: 43)
    8.  
    9. Message from debugger: Terminated due to memory issue
    I used Replaykit before, It had problems which is why I am here but the memory thing is new to me. It happens about 1 to 2 seconds after I hit the record button.
     
  26. kevinpaulharper_unity

    kevinpaulharper_unity

    Joined:
    Mar 8, 2018
    Posts:
    4
    PS: recording works on Mac.
     
  27. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    What device are you running on, what graphics API are you using (Metal or OpenGL ES), and what is your recording configuration (resolution and framerate)?
     
  28. unity_WZcjjPmfXipXXA

    unity_WZcjjPmfXipXXA

    Joined:
    Oct 13, 2017
    Posts:
    6
    Hello, my firm bought your plugin and I try to use it.
    But I have a issue.

    I try to record many times a video, like
    //begin with
    this.replayCam.StartRecording ();
    //then
    this.replayCam.StopRecording ();
    // this file is good

    this.replayCam.StartRecording ();
    //then
    this.replayCam.StopRecording ();
    // this file is an another file, but it is empty and I dont have error

    Can you help me please ?
     
  29. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    How long are you recording for? Can you share your code?
     
  30. unity_WZcjjPmfXipXXA

    unity_WZcjjPmfXipXXA

    Joined:
    Oct 13, 2017
    Posts:
    6
    Code (CSharp):
    1.     [SerializeField] private ReplayCam replayCam;
    2.  
    3.     public void startCapture() {
    4.         this.replayCam.StartRecording ();
    5.  
    6.         this.storyGameController.goToPlay ();
    7.     }
    8.  
    9.     public void pauseCapture() {
    10.         this.replayCam.PauseRecording ();
    11.  
    12.         this.storyGameController.goToPause ();
    13.     }
    14.  
    15.     public void resumeCapture() {
    16.         this.replayCam.ResumeRecording ();
    17.  
    18.         this.storyGameController.goToPlay ();
    19.     }
    20.  
    21.     public void stopCapture() {
    22.         this.replayCam.StopRecording ();
    23.  
    24.         this.storyGameController.next();
    25.     }
    26.  
    27.     public void resetCapture() {
    28.         this.replayCam.RestartRecording ();
    29.  
    30.         this.storyGameController.goToRestart ();
    31.     }
     
  31. unity_WZcjjPmfXipXXA

    unity_WZcjjPmfXipXXA

    Joined:
    Oct 13, 2017
    Posts:
    6
    I am recording between 5 and 10 seconds to test
     
  32. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    You mentioned that you don't get an error on the second recording. Check that you are recording for enough time, not just one frame. Also, I strongly recommend using NatCorder directly (Replay/NatCorder functions) instead of using ReplayCam, our example scene.
     
  33. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Can you share the logs? What platform are you recording on?
     
  34. unity_WZcjjPmfXipXXA

    unity_WZcjjPmfXipXXA

    Joined:
    Oct 13, 2017
    Posts:
    6
    Ok, i will try

    I am recording on UnityEditor for the moment, and after i would on Android, IOS and Windows
     
  35. kevinpaulharper_unity

    kevinpaulharper_unity

    Joined:
    Mar 8, 2018
    Posts:
    4
    iPhone X, Metal, Config is Screen.
    Code (CSharp):
    1.  Replay.StartRecording(Camera.main, Configuration.Screen, OnReplay,listener);
     
  36. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    You might want to reduce the screen resolution, since the iPhone X has a very high screen resolution. The H.264 codec doesn't do well with resolutions greater than 1920x1080.
     
  37. niv_onehamsa

    niv_onehamsa

    Joined:
    Oct 30, 2016
    Posts:
    7
    Hey there,

    I've run into an issue with audio recoding on iOS.
    I have some custom use of recorder so i'm using NetCorder.AcquireFrame / CommitFrame interfaces. The video looks great but i'm getting no audio bytes in the final video even though i'm committing audio samples.

    The same exact code works great on Windows but not on iOS ...

    Are there any iOS specific restrictions when doing commit samples in iOS? I can commit audio samples from the audio thread correct?

    Any assistance would be appreciated and great work on the plugin!
     
  38. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Can you share your code? Are you sure that the video has no audio track? Or is the audio too quiet to be heard? Try saving the video to the camera roll (using NatShare) and play it from there.
     
  39. jrcharland

    jrcharland

    Joined:
    Dec 19, 2014
    Posts:
    2
    Hi,
    I'm running in the same issue than niv_onehamsa, but on Mac.

    When using the Replay call I get audio, but if I use NatCorder while committing audio sample via the audioGetter script I get no audio bytes at all. Can't get the mic nor a clip audio even though I'm hearing them in the scene and I'm seeing the OnAudioFilterRead being called.

    This is my audioGetter script
    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. using System.Collections;
    4. using NatCorderU.Core;
    5.  
    6. /*
    7. * We attach this script to an AudioSource/AudioListener
    8. * and forward the audio to NatCorder
    9. */
    10.  
    11. [RequireComponent(typeof(AudioSource))]
    12. public class AudioGetter : MonoBehaviour, IAudioSource
    13. {
    14.     public int sampleRate
    15.     {
    16.         get
    17.         {
    18.             return AudioSettings.outputSampleRate;
    19.         }
    20.     }
    21.  
    22.     public int sampleCount
    23.     {
    24.         get
    25.         {
    26.             int buffLen, numBuffer;
    27.             AudioSettings.GetDSPBufferSize(out buffLen, out numBuffer);
    28.             return buffLen;
    29.         }
    30.     }
    31.  
    32. public int channelCount { get { return (int)AudioSettings.speakerMode; } }
    33.  
    34.  
    35.  
    36.     public void Dispose()
    37.     {
    38.         Debug.Log("Disposed, but not implemented");
    39.     }
    40.  
    41.  
    42.     private void OnAudioFilterRead(float[] samples, int channels)
    43.     {
    44.         long timestamp = (long)(AudioSettings.dspTime * 1e+9f);
    45.         NatCorder.CommitSamples(samples, timestamp);
    46.         Debug.Log("tick");
    47.     }
    48. }

    And this is the part where I call the start the 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.  
    6.         // Start recording with microphone audio
    7.         StartMicrophone();
    8.  
    9.          // Get the `AudioGetter` component we created (now attached to an AudioSource or AudioListener)
    10.          AudioGetter audioGetter = audioSource.GetComponent<AudioGetter>();
    11.  
    12.          NatCorder.StartRecording(configuration, callBackVideo, audioGetter);
    13.     }
    14.  
    15.  
    16.     private void Update()
    17.     {
    18.         //Just to be sure there's something on the other end
    19.         if (cameraPreview.cameraTexture == null) return;
    20.         // Check that we are recording, and that the webcamtexture was updated this frame
    21.         if (!NatCorder.IsRecording || !cameraPreview.cameraTexture.didUpdateThisFrame) return;
    22.         // Acquire an encoder frame
    23.         var frame = NatCorder.AcquireFrame();
    24.         // Blit the webcam preview to the frame
    25.         Graphics.Blit(cameraPreview.cameraTexture, frame);
    26.         // Now commit the frame to the encoder
    27.         NatCorder.CommitFrame(frame);
    28.     }
    29.  
    30.  
    31.     private void StartMicrophone()
    32.     {
    33.         #if !UNITY_WEBGL || UNITY_EDITOR // No `Microphone` API on WebGL :(
    34.         // If the clip has not been set, set it now
    35.         if (audioSource.clip == null)
    36.         {
    37.             audioSource.clip = Microphone.Start(null, true, 60, 48000);
    38.             while (Microphone.GetPosition(null) <= 0) ;
    39.         }
    40.  
    41.         // Play through audio source
    42.         audioSource.timeSamples = Microphone.GetPosition(null);
    43.         audioSource.loop = true;
    44.         audioSource.Play();
    45.         #endif
    46.     }

    Would appreciate some help
    Thanks
     
  40. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Can you email me a repro?
     
  41. buckUnity

    buckUnity

    Joined:
    Apr 23, 2018
    Posts:
    10
    Hi,
    I'm using the snippet of code below as my configuration.
    Code (CSharp):
    1. public Vector2Int MaxVideoSize = new Vector2Int(1080, 1920);
    2. Configuration config = Configuration.Screen;
    3.             if (Screen.width > MaxVideoSize.x || Screen.height > MaxVideoSize.y) {
    4.                 Vector2Int videoSize = new Vector2Int(Screen.width, Screen.height);
    5.                 float screenRatio = Camera.main.aspect;
    6.                 if (videoSize.x > MaxVideoSize.x) {
    7.                     // clamp by width
    8.                     videoSize.x = Mathf.Min(videoSize.x, MaxVideoSize.x);
    9.                     videoSize.y = Mathf.FloorToInt((float) videoSize.x / screenRatio);
    10.                 }
    11.                 if (videoSize.y > MaxVideoSize.y) {
    12.                     // clamp by height
    13.                     videoSize.y = Mathf.Min(videoSize.y, MaxVideoSize.y);
    14.                     videoSize.x = Mathf.FloorToInt((float) videoSize.y * screenRatio);
    15.                 }
    16.                 config = new Configuration(videoSize.x, videoSize.y, config.framerate, config.bitrate, config.keyframeInterval);
    17.             }
    On my iPhone 6s when I replay the recording I made in Unity, the screen tears when I do a playback on the app. However, when I save the video to device and view in iPhone's Photo library there is no more tear and the video is perfectly recorded

    IMG_0181.jpg
    On my iPhone 6s+ when I record a video, I straight up crash after 1 second of recording. This occurs even if I lower the screen resolution record to 720p. Xcode gives WARNING -> applicationDidReceiveMemoryWarning()

    Screen Shot 2018-06-13 at 4.20.00 PM.png
    Was wondering if you can point me to the right direction to fix these issues. Thank you!

    EDIT: I forgot to mention that these recordings are happening at 60fps
    EDIT2: I tested it on 30fps with 1280x720 and the crash still occurs on iPhone 6s+, but I am able to record a bit longer (approximately 2-3 seconds)
     
    Last edited: Jun 14, 2018
  42. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    I have a few questions:
    - Is your app using Metal? I'd assume so since your screenshot shows MTLDebugRenderCommandEncoder
    - How much memory is your app using during runtime? Can you share a screenshot of the memory profiler tab in Xcode?
    - Can you share more of your recording code? If you are manually pushing frames through NatCorder (using the NatCorder API to record, as opposed to the Replay API), then you have to actually time how often you commit frames to correspond to your intended video framerate. So if you are committing a video frame in every app frame, and your app runs at 60FPS, you have to manually skip every other frame.
    - When using your resolution clamping logic, what is the final resolution that gets put into the configuration you create?

    This issue is very interesting because you mentioned that it crashes on the 6S+ and not the 6S. From what I recall, they have the same internals.
     
  43. buckUnity

    buckUnity

    Joined:
    Apr 23, 2018
    Posts:
    10
    1) Yes my app is using Metal
    2) Memory usage is hovering around 1GB
    Screen Shot 2018-06-14 at 10.33.53 AM.png
    3) I am using the Replay API. I'm using the code provided by ReplayCam to start the recording. Even when I revert back to the following code below there is still a crash on the iPhone 6s+. In the iPhone 6s there is no more tearing during the playback.
    Code (CSharp):
    1.         public void StartRecording () {
    2.             // Create a recording configuration
    3.             const float DownscaleFactor = 2f / 3;
    4.             var configuration = new Configuration((int)(Screen.width * DownscaleFactor), (int)(Screen.height * DownscaleFactor));
    5.             // Start recording with microphone audio
    6.             if (recordMicrophoneAudio) {
    7.                 StartMicrophone();
    8.                 Replay.StartRecording(Camera.main, configuration, OnReplay, audioSource, true);
    9.             }
    10.             // Start recording without microphone audio
    11.             else Replay.StartRecording(Camera.main, configuration, OnReplay);
    12.         }
    4) The final clamped for the iPhone 6s+ is 1920 x 1080. The final clamped for iPhone 6s is 1334, 750. I did notice that when I have the resolution at 1920 x 1080 for the iPhone 6s that also causes a crash as well.
     
  44. jakkovanhunen

    jakkovanhunen

    Joined:
    Oct 20, 2008
    Posts:
    79
    Hi, I'm receiving tons of kFigBlockBufferUnallocatedBlockErr errors when recording audio on iOS devices resulting in choppy recording.

    To start recording I use the following
    Code (CSharp):
    1.         Replay.StartRecording(
    2.             recordingCamera,
    3.             _videoConfiguration.GetConfiguration(recordingCamera),
    4.             OnReplayRecordingFinished,
    5.             recordingCamera.GetComponent<AudioListener>()
    6.         );
    Any thoughts?

    This is what the log says:
    Code (CSharp):
    1.  
     
  45. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Your overall setup looks good, and your device still has a lot of memory left (about half a gig). Can you share a screenshot of the GPU tab (frame time) in Xcode when the app is not recording?
     
  46. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    You must be on the iOS 12 beta. Apple broke something, which is what causes error. Until they fix it, there isn't any workaround I can implement.
     
  47. jakkovanhunen

    jakkovanhunen

    Joined:
    Oct 20, 2008
    Posts:
    79
    Ah yes... thanks. Was indeed on iOS 12 devices over the weekend. Works as expected on iOS 11. Got a bit mixed up with errors that occurred on the iOS 11 devices (that I resolved).
     
    Lanre likes this.
  48. sd-Baek

    sd-Baek

    Joined:
    Jul 25, 2013
    Posts:
    2
    Hello, I'm working on Unity 2017.3.1f1 and Natcoder newest version.

    I have a trouble on use this asset.
    after first recording with Replay class, I switched to another screen for sharing, and return unity screen. and then record once more, video has abnormally recorded. (e.g. i record video while few seconds, but video has recorded over 10 min)

    Have you ever reported on issues related to this? I'm experiencing this issue on Android/iOS devices.
     
    Last edited: Jun 18, 2018
  49. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    1,737
    Are you recording with audio? And are you pausing the recording or stopping it? Can you share your code?
     
  50. buckUnity

    buckUnity

    Joined:
    Apr 23, 2018
    Posts:
    10
     

    Attached Files: