Search Unity

NatCorder - Video Recording API

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

  1. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    Any update on the release date? We are currently delaying a launch waiting for the fix.
     
  2. blackhawk_001

    blackhawk_001

    Joined:
    Jan 25, 2019
    Posts:
    11
    hi guys, can someone show me how to screen record for arcore app. i already follow replayCam. after push record button, my video freeze?
     
  3. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    1.6.1 is live.
     
  4. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    What device does this happen on? You say your video freezes, what video? Please be exact when describing issues like this.
     
  5. BLT_Dev

    BLT_Dev

    Joined:
    Apr 14, 2018
    Posts:
    4
    I have the same issue. It will not record audio. I reached out to the developer and was assured the 1.6.1 version would have a fix. Updated my project today with the latest version and it also does not work. Even just deploying the ReplayCam example to my Android phone crashes every time. I feel this is not tested thoroughly.

    My project is held up cause of this issue and I'll have to look into another solution. I am also doing an ARCore app, so I need to essentially screen capture the session and capture and the audio as well. Seems if I enable the microphone the app freezes. Without that checked it records fine. I am testing on a Galaxy S7 and a Note 9.

    I used the NatCorder plugin back when it was 1.2 and had no issues. However the latest iterations feel unfinished. Even the Asset Store has links to the documentation, which takes you to the 1.3 version!
     
  6. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I wasn't able to reproduce a crash when recording audio on the ReplayCam example. There was definitely a sporadic crash when trying to record audio in 1.6.0, an issue which we explicitly fixed. Crashes are a manifestation of potentially very different underlying causes (for instance, it could be a permissions issue which is trivial). I never asked for a crash log from you to confirm that this was in fact the same issue as the other one we fixed, so my bad on that. Email me the full (unfiltered) logs from logcat in a .txt file.
    Definitely sounds like permissions. The ReplayCam example intentionally runs a hot loop until the microphone has started.
    Because of the microphone issue? Please expatiate.
    We have been deliberating entirely removing the online docs, because the asset itself includes docs (and those are always updated, you can verify this by opening index.html in NatCorder > Docs). To avoid confusion, I'll remove all online docs now.
     
  7. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    NatCorder 1.6.1 has significant performance improvements when recording from a RenderTexture (and reflexively, when recording from a game camera) on iOS and Android:

    1.5.1 (used Texture2D.ReadPixels):
    1.5.1.png
    1.6.0 (used AsyncGPUReadback):
    1.6.0.png
    1.6.1 (uses our custom Metal texture readback):
    1.6.1.png
     
  8. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    I updated to the new v1.6.1, but I'm facing an issue with it. When executing the example ReplayCam, everything works fine and the recording is saved. But when playing the scene again in the editor, it becomes stuck and is necessary to use Task Manager to kill the process and restart Unity. I've re-imported the plugin to discard any external issues, and it still has the same behaviour.
    Thanks for your help with this problem.
     
  9. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    When starting to record in Android, it immediately crashes. Attached is the resulting log.
     

    Attached Files:

    • log2.txt
      File size:
      191.2 KB
      Views:
      672
  10. edee1337

    edee1337

    Joined:
    Apr 10, 2013
    Posts:
    34
    Thank you for your hard work! Just updated to 1.6.1 and see the tremendous performance improvements. Unfortunately, also facing a few issues:

    1) There is a 1-2 second lag on-device (in this case an iPhone X) when starting each video record session. This breaks AR tracking and leads to a bad user experience. For this reason alone I have to keep using NatCorder 1.4, where there is lag at the start of only the first record session, which can be worked around by starting and stopping a session on app startup and disposing the video.

    2) This update now causes Unity to hang when doing the following: press play in editor to start app > record video > stop recording video > press play to stop app > press play again to start app > Unity hangs. This is with 2018.4.4 on MacOS 10.14.5, build target iOS. Starting and stopping multiple record sessions in a row on device, however, works fine.
     
    Lanre likes this.
  11. mathias_unity633

    mathias_unity633

    Joined:
    Jul 17, 2018
    Posts:
    35
    Awesome update!

    I tested it on a build, worked like a charm. But archiving it results in undefined symbols for armv7. Is it possible to get a build that has support for this, or is there some other workaround? I know support will be dropped in the future, but we still have users on armv7 :)
     
  12. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Windows or macOS editor?
     
  13. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Ah I think I know why this happens. Just to confirm my suspicion, open Player Settings and disable multithreaded rendering. Let me know if it still crashes (it shouldn't).
     
  14. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I can't reproduce this. I get some lag on the first recording, but this is unavoidable as the encoder is starting up. But on subsequent recordings, there is no lag. Also the first lag is nowhere close to 1-2 seconds, more like a few hundred milliseconds (recording 1920x1080 at 60FPS).
    I'll look into this.
     
  15. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    We build for iOS 11, which doesn't support building armv7 slices. Armv7 has been officially deprecated by Apple for a while now, and the market share reflects this very much.
     
  16. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    Windows Editor, Unity 2019.1.12f1
     
    Lanre likes this.
  17. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    it works now.

    But the audio sounds really bad, playing saved video, console prints lots of "AudioSampleProvider buffer overflow. 1216 sample frames discarded."

    NatCorder shows this when recording:
    Code (CSharp):
    1. 08-09 09:54:52.083: I/Unity(12890): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
    2. 08-09 09:54:52.213: V/Unity(12890): NatCorder: Preparing MP4 video encoder with format: {color-format=2130708361, i-frame-interval=3, mime=video/avc, width=1520, bitrate=2340000, frame-rate=30, height=854}
    3. 08-09 09:54:52.316: V/Unity(12890): NatCorder: Preparing MP4 audio encoder with format: {channel-mask=16, sample-rate=48000, mime=audio/mp4a-latm, channel-count=1, aac-profile=2, bitrate=64000, max-input-size=8192}
    4. 08-09 09:54:52.460: V/Unity(12890): NatCorder: MP4 audio encoder changed output format: {max-bitrate=64000, sample-rate=48000, mime=audio/mp4a-latm, channel-count=1, bitrate=64000, csd-0=java.nio.HeapByteBuffer[pos=0 lim=2 cap=2]}
    5. 08-09 09:54:52.470: V/Unity(12890): NatRender: Created ES3 GLRenderContext
    6. 08-09 09:54:52.506: I/Unity(12890):
    7. 08-09 09:54:52.506: I/Unity(12890): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
    8. 08-09 09:54:52.841: V/Unity(12890): NatCorder: MP4 video encoder changed output format: {max-bitrate=2340000, csd-1=java.nio.HeapByteBuffer[pos=0 lim=8 cap=8], color-transfer=3, mime=video/avc, width=1520, bitrate=2340000, color-range=2, frame-rate=30, color-standard=2, height=854, csd-0=java.nio.HeapByteBuffer[pos=0 lim=22 cap=22]}
    9. 08-09 09:54:54.458: V/Unity(12890): NatRender: Released GLRenderContext
    10. 08-09 09:54:54.464: V/Unity(12890): NatRender: Created ES3 GLRenderContext
    11. 08-09 09:55:04.660: V/Unity(12890): NatCorder: MP4 video encoder encountered EOS
    12. 08-09 09:55:04.663: V/Unity(12890): NatCorder: MP4 audio encoder encountered EOS
    13. 08-09 09:55:04.665: V/Unity(12890): NatRender: Released GLRenderContext
     
  18. edee1337

    edee1337

    Joined:
    Apr 10, 2013
    Posts:
    34
    Found the culprit: was calling iPhoneSpeaker.ForceToSpeaker() before recording, which combined with NatCorder / NatMic leads to the delay. Need to test more to see if its ok to remove this line, but without it record delay is minimal, which preserves AR tracking :)

    I am, however, having issues with data synchronization because the new API no longer allows us to manually commit timestamps. Am I missing something or has it been removed?

    Thanks again!
     
    Lanre likes this.
  19. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    The NatCorder logs look normal. Are you running the ReplayCam example?

    EDIT: What audio are you recording? You channel count is 1 (mono), which is not a conventional setting when recording Unity game audio.
     
  20. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    What do you mean the new API doesn't allow to commit timestamps? None of this has changed (see the Changelog for a list of changes between versions).
     
  21. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    This is my setup:

    Code (CSharp):
    1.  
    2.         NatCorderMP4Recorder = new MP4Recorder(
    3.             Ancho,
    4.             Alto,
    5.             30,
    6.             AudioSettings.outputSampleRate,
    7.             (int)AudioSettings.speakerMode,
    8.             OnVideo,
    9.             2340000
    10.         );
    And this is where i get the audio data:
    Code (CSharp):
    1.  
    2.     private void OnAudioFilterRead(float[] data, int channels) {
    3.         if (Recording) {
    4.             NatCorderMP4Recorder.CommitSamples(data, recordingClock.Timestamp);
    5.             if (mute) Array.Clear(data, 0, data.Length);
    6.         }
    7.     }
     
  22. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Are you forcing Unity to produce mono audio?
     
  23. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    Yes
     
  24. kamihiro74

    kamihiro74

    Joined:
    May 15, 2013
    Posts:
    20
    hi, I have a problem with recording the screen. when I record 3-4 times, the app will just freeze, the background music is still playing but the screen is freeze. This only happened to new iPad pro (11inch)
    the Natrecorder version I used is 1.4.0, I also tried 1.6.1 but it was the same result.

    I have attached the log from iOS.
    Thank you!
     

    Attached Files:

  25. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Can you try 1.6.1 and send the logs? The code for 1.6.1 and 1.4.0 aren't the same.
     
  26. nikosurfing

    nikosurfing

    Joined:
    Mar 11, 2014
    Posts:
    45
    Hi, nice update, thank you
    But i have same issue about editor crash, i have disabled the multithread rendering but it still crashed.

    How to reproduce this issue:

    - Press play in editor to start app > record video > stop recording video > press play again in editor > Unity hangs. This is with 2018.3.14f1 on Win 10, build target android.
     
  27. kamihiro74

    kamihiro74

    Joined:
    May 15, 2013
    Posts:
    20
    hi,Thank you for help,
    here is the log by 1.6.1
    it is the same as 1.4
    Code 0x8badf00d
     

    Attached Files:

    • log.txt
      File size:
      108.2 KB
      Views:
      654
  28. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    I am still facing that issue too, disabling multithread rendering only solves Android crash.
     
  29. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    I went back to stereo and works fine again on Android.

    Editor still gets freeze.
     
  30. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    When using the ReplayCam example, I'm getting an error when recording with the microphone (audio) on. I've tested two cases, the first is without using the microphone, which creates the video well and can be shared without problem. But when recording with the mic on, the file is created, but at the moment of sharing it (for example Facebook or Whatsapp) the file cannot be played. To further prove this, when running the following command "ffmpeg.exe -v error -i video.mp4 -f null - >error.log 2>&1", it can be seen that the file is partially corrupt.

    Again, Android..

    Log with mic off:
    Code (CSharp):
    1. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 1 >= 1
    2. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 3 >= 3
    3. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 7 >= 7
    4. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 9 >= 9
    5. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 18 >= 18
    6. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 21 >= 21
    7. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 25 >= 25
    8. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 36 >= 36
    9. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 41 >= 41
    10. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 44 >= 44
    11. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 46 >= 46
    12. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 52 >= 52
    13. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 63 >= 63
    14. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 68 >= 68
    15. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 78 >= 78
    16. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 82 >= 82
    17. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 88 >= 88
    18. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 97 >= 97
    19. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 119 >= 119
    20. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 126 >= 126
    21. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 132 >= 132
    22. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 144 >= 144
    23. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 150 >= 150
    24. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 164 >= 164
    25. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 166 >= 166
    26. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 169 >= 169
    27. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 175 >= 175
    28. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 178 >= 178
    29. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 181 >= 181
    30. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 184 >= 184
    31. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 186 >= 186
    32. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 189 >= 189
    33. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 192 >= 192
    34. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 195 >= 195
    35. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 197 >= 197
    36. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 200 >= 200
    37. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 203 >= 203
    38. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 206 >= 206
    39. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 209 >= 209
    40. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 214 >= 214
    41. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 217 >= 217
    42. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 220 >= 220
    43. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 222 >= 222
    44. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 228 >= 228
    45. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 231 >= 231
    46. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 235 >= 235
    47. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 247 >= 247
    48. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 250 >= 250
    49. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 253 >= 253
    50. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 260 >= 260
    51. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 268 >= 268
    52. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 270 >= 270
    53. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 273 >= 273
    54. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 281 >= 281
    55. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 284 >= 284
    56. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 287 >= 287
    57. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 290 >= 290
    58. [null @ 000001cfc35f5a80] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 294 >= 294
    59.  
    Log with mic on:
    Code (CSharp):
    1. [aac @ 000001dd2228c300] Input buffer exhausted before END element found
    2. [aac @ 000001dd2228db80] Input buffer exhausted before END element found
    3. Error while decoding stream #0:0: Invalid data found when processing input
    4. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 19 >= 19
    5. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 24 >= 24
    6. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 28 >= 28
    7. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 30 >= 30
    8. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 32 >= 32
    9. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 34 >= 34
    10. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 36 >= 36
    11. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 39 >= 39
    12. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 42 >= 42
    13. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 47 >= 47
    14. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 49
    15. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 51 >= 51
    16. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 55 >= 55
    17. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 64 >= 64
    18. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 70 >= 70
    19. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 72 >= 72
    20. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 76 >= 76
    21. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 78 >= 78
    22. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 87 >= 87
    23. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 93 >= 93
    24. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 96 >= 96
    25. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 99 >= 99
    26. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 101 >= 101
    27. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 104 >= 104
    28. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 110 >= 110
    29. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 114 >= 114
    30. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 118 >= 118
    31. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 121 >= 121
    32. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 123 >= 123
    33. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 132 >= 132
    34. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 135 >= 135
    35. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 139 >= 139
    36. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 142 >= 142
    37. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 157 >= 157
    38. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 161 >= 161
    39. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 166 >= 166
    40. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 169 >= 169
    41. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 171 >= 171
    42. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 175 >= 175
    43. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 179 >= 179
    44. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 183 >= 183
    45. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 187 >= 187
    46. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 192 >= 192
    47. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 196 >= 196
    48. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 200 >= 200
    49. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 206 >= 206
    50. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 214 >= 214
    51. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 226 >= 226
    52. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 233 >= 233
    53. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 237 >= 237
    54. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 242 >= 242
    55. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 245 >= 245
    56. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 250 >= 250
    57. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 253 >= 253
    58. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 255 >= 255
    59. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 257 >= 257
    60. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 259 >= 259
    61. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 263 >= 263
    62. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 270 >= 270
    63. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 272 >= 272
    64. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 275 >= 275
    65. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 289 >= 289
    66. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 294 >= 294
    67. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 297 >= 297
    68. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 307 >= 307
    69. [null @ 000001dd229f2040] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 313 >= 313
    70.  
     
  31. shacharoz

    shacharoz

    Joined:
    Jul 11, 2013
    Posts:
    98
    i agree. happens to me as well.
     
  32. shacharoz

    shacharoz

    Joined:
    Jul 11, 2013
    Posts:
    98
    first the API in this article is irrelevant for experiments with live camera : https://medium.com/@olokobayusuf/natcorder-unity-recording-made-easy-f0fdee0b5055
    since it doesnt work out of the box.

    you samples in the plugin have a different namespace. and i cant seem to make it work (i have now tried to update again and things got damaged).

    third, a lot of people here are facing issues with making this to work on mobile and then on AR. i am willing to pay 5-10 dollar more if you make an example showing this!
    or maybe even better for you- make another plugin as such example (that depends on having this one).

    i hope you take these as suggestions, rather than critic. i really want this plugin to work but right now im stuck.
     
  33. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    The editor issue is separate from the one on Android. I have submitted an update that fixes the crash on Android.
     
  34. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    This issue is explicitly from Unity as far as I can tell (GetNativeTexturePtr is crashing). File a bug report with Unity.
     
  35. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I'll check this out. Are you able to playback the recorded video on Android?
     
  36. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Are you using 1.6.1?
    I've updated the code (it was for NatCorder 1.5, forgot to update it to the 1.6 API).
    We renamed the overarching namespace to `NatCorder` in 1.5 (see the Changelog.md where we keep a comprehensive list of changes) and it hasn't changed (and will not change).
    An example showing what? A lot of developers use NatCorder with ARKit, ARCore, and Vuforia. Using NatCorder with any of these is as simple as modifying the ReplayCam code to record their AR game camera (instead of Camera.main).
     
    shacharoz likes this.
  37. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    Yes, I can even play it inside unity with a videoplayer but at the end of the video, it starts spamming "AudioSampleProvider buffer overflow"
     
  38. alonlevi

    alonlevi

    Joined:
    Apr 22, 2019
    Posts:
    11
    Bravo on performance!
    After the degrade in performance in 1.6 this is great...
    I'm adding my voice to the fact that Unity Editor is stuck after recording, stopping and pressing play again... does seems to work good on android though.
     
    Lanre likes this.
  39. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Okay I'll check this out. Thanks.
     
  40. andrewdSuper77

    andrewdSuper77

    Joined:
    Jul 12, 2019
    Posts:
    15
    Alright, I'm attempting to see if the 1.6.1 update would help, but I'm seeing compilation errors when importing in updated natcorder scripts.

    Assets/3rd Party/NatCorder/Plugins/Managed/Internal/AsyncGPUReadback.cs(19,13): error CS0103: The name 'Dispatcher' does not exist in the current context

    Is there another auxiliary package I need to install? Doesn't appear to be using the .Net dispatcher, as we are using the latest .net settings
     
  41. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Always delete NatCorder in your project before importing an update from the Asset Store.
     
  42. shacharoz

    shacharoz

    Joined:
    Jul 11, 2013
    Posts:
    98
    hi guys and lanre :),
    so i also updated to 1.6.1
    running the sample out of the box on the Editor and it works.
    made an android build, the video is recorded and replayed, but i cant find the file on the phone. does anybody know where to look? i found the com.XXX.YYY folder, in the Android\data\ folder, but its not there.

    does anybody managed to bring it to the gallery?
     
  43. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    NatCorder always records to the app's private documents directory. You can use NatShare API (it's open source) to copy the video to the camera roll on mobile platforms.
     
    shacharoz likes this.
  44. andrewdSuper77

    andrewdSuper77

    Joined:
    Jul 12, 2019
    Posts:
    15
    Thanks, after fixing that, I found a workaround to make the two systems work together. It involves two cameras, the first for the Real work background, and the second for the culled out AR objects. The first one with the background is for some reason twisted 90* counterclockwise and only on device. It stretches to fit the video size as well I can email a video of the effect if needed. Looks like the issue stops if I only use one camera. Seen on iOS working on getting an android to test reproducibility there
     
    Last edited: Aug 15, 2019
    Lanre likes this.
  45. MonSterJ

    MonSterJ

    Joined:
    Nov 13, 2018
    Posts:
    1
    I packaged the 32-bit exe under window platform. Why did the program flash back after recording.
     
  46. JoakimOlsson

    JoakimOlsson

    Joined:
    May 20, 2019
    Posts:
    11
    Are you aware of any issue(s) of Android crashing when recording using a combination of NatCam (1.6) and NatCorder (2.2.1)?

    Have tested on two different devices (different in performance) and sometime after roughly 17 seconds of recording the app simply dies, both in our actual project as well in new, clean, project. Have used both the InputCamera class as well as a "copied" implementation of its "CommitFrame" that use a Texture instead of a RenderTexture. Both implementations will crash after a certain recording period has elapsed.
     
  47. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    NatCorder doesn't support 32-bit on standalone platforms (Windows or macOS).
     
  48. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Use NatCam's CaptureFrame method to get the preview data, then commit that preview data directly. Can you share your code?
     
  49. JoakimOlsson

    JoakimOlsson

    Joined:
    May 20, 2019
    Posts:
    11
    The problem stopped when commenting out the "if (SystemInfo.supportsAsyncGPUReadback)" and "else if (Application.platform == RuntimePlatform.Android)", forcing the app to use the non-async implementation. I see that this has been completely changed in 1.6.1, so will probably work better now.
     
  50. dryraa

    dryraa

    Joined:
    Apr 10, 2017
    Posts:
    8
    Hello Lanre,
    I wanted to say well done on the plugin, it is great and super performant for Augmented Reality! I unfortunately wasted 3 days trying to pin down why the app crashes when using the ReplayCam script on Android, up until I stumbled on this thread, and found out it was the multithreading thing. Thank you for the fix!