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. CNGameDev01

    CNGameDev01

    Joined:
    Feb 1, 2016
    Posts:
    4
    Hi,

    we've encounter a color issue where our application recorded video show different color than what it is in the application. This only happen to ios, no issue on android. (Unity version: 2019.2.5f1, NatCorder 1.6.0)
    Please see attach images.

    Please get back as soon as possible.

    Thanks.
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      104.9 KB
      Views:
      155
    • 2.jpg
      2.jpg
      File size:
      140.4 KB
      Views:
      95
  2. rumit48

    rumit48

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

    you ignored my message above, I'll repeat.
    We have issue on iOS target with inverting color when recording video. No issue on Android.
    NatCorder 1.6.2, Unity 2019.2.6f1, Vuforia 8.3.8.
    Do you have a solution?
     
  3. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    I'm working on it and once I have a fix, I'll post about it.
     
  4. rumit48

    rumit48

    Joined:
    Apr 26, 2017
    Posts:
    4
    Thanks for your reply, we'll wait!
     
  5. LeeLorenzSr

    LeeLorenzSr

    Joined:
    May 3, 2015
    Posts:
    22
    Strange. At one point, it recorded fine, but now, seemingly without any parameter changes, it is recording the video at twice the speed of the audio (audio normal). The remaining video is black, ending exactly halfway through the clip. This is on an android, in Windows, it records both audio and video in sync.
     
  6. nikosurfing

    nikosurfing

    Joined:
    Mar 11, 2014
    Posts:
    43
    Please check your mail, i'll test it to my current project
     
    Lanre likes this.
  7. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    308
    I am not sure I clearly understood your answer. ARFoundation camera is a separate camera witch renders only device real camera view (in my case) and I have other cameras to render other elements. So, what is the approach here? Temporarily change ARFoudnation camera layers while recording? Or there is some other way?

    And another question before I make a purchase (just to be sure) - how recorded video saved? I mean, how can I use it for preview setting up a player functionality (seeking/pause/play)
     
    Last edited: Sep 25, 2019
  8. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    24
    Greetings, currenty I'm using the latest version of NatCorder (1.6.2), and at the moment of recording in iOS the app immediately crashes. It has been tested in an iPhoneX and an iPhone 6, with the same results in both devices. In Android is working normally as expected.
    I'm using RenderTextureInput for the recording. While trying to come up with a quick solution, the following lines where commented in the CommitFrame method (see below), which allowed to record again, but causes the colors to come out inverted. In the attached image, it can be seen how the first is the original UI (blue background) and the second is the resulting recording.
    I would appreciate a quick fix for these issues as they are currently delaying an update for my game.
    Thanks for your help.

    Original:
    WhatsApp Image 2019-09-26 at 8.55.51 PM.jpeg
    Recorded:

    WhatsApp Image 2019-09-26 at 8.55.58 PM.jpeg
    Commented Code:

    WhatsApp Image 2019-09-26 at 9.05.24 PM.jpeg
     
  9. nikosurfing

    nikosurfing

    Joined:
    Mar 11, 2014
    Posts:
    43
    @Bongo_Studios, nice game btw, what the name of your game anyway? and do you have jittering / stutter / jank / freeze when duration of video more than 10s issues?
     
  10. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    24
    Thanks for your comments about the game, is called Guitaring and is available both in Play Store and App Store.
    Currently there is no issue with long duration recordings.
     
  11. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    I'm working on fixing this. Sorry for the delay.
     
  12. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Yeah, you can set the layers on the ARFoundation camera so that it sees only game objects that you want in the video. You can also create a second game camera to see these objects, then record both the ARFoundation camera and this camera (you can record multiple game cameras simultaneously with the CameraInput script).
    Videos are always saved to the app's private documents directory. NatCorder will give you the path to the recorded video once recording is complete. I'm not sure what you mean by "use it for preview setting up a player functionality".
     
  13. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Email me to test a build that should fix this.
     
  14. PavanJ

    PavanJ

    Joined:
    Nov 13, 2017
    Posts:
    1
    Hi. I was wondering if Natcorder supports recording videos in UWP?
     
  15. andrewdecker

    andrewdecker

    Joined:
    Jul 12, 2019
    Posts:
    15
    I am having an issue where once I record and finish recording, if I stop the editor, and either make a compilation change or restart the editor, it hangs indefinitely. I have narrowed the issue to within the despose calls.

    Repro Steps:
    1 Open Editor Fresh
    2 Start Editor
    3 Begin Recording
    4 Finish Recording
    5 Stop Editor
    6a Edit Scripts to Trigger a compilation change
    6b Hit play to attempt to restart playmore
    7 Observe

    Observed: Editor Hangs/Freezes
    Expected: Compilation Completes/Game Plays/ No freeze

    Was able to replicate with replay cam example
     
  16. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    We don't develop for UWP.
     
  17. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Upgrade to the latest version of NatCorder on the Asset Store. This issue has been fixed.
     
  18. eetuheikkinen

    eetuheikkinen

    Joined:
    Feb 12, 2018
    Posts:
    1
    Hi,@Lanre!

    I use natcorder in one of our android projects but it saves the videos in unplayable, 0 byte file size. I tried all the example scenes with same result. It works as it should in Unity’s play mode but not on the desired android device.

    Do you know what’s possibly causing the problem?

    -Eetu
     
  19. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    What Android device does this happen on? Can you upload the full logs from logcat?
     
  20. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    688
    Anybody knows how to read the actual hardware time? I have to synchronize part of a game play to a video, and i need to know the exact time. Reading Time.time several times in the same frame returns the same time, so that wont work, i need to get the actual hardware time so i can know how many actual ticks went by so i can sync with the video.
     
  21. LeeLorenzSr

    LeeLorenzSr

    Joined:
    May 3, 2015
    Posts:
    22
    Make sure you are not using the Vulkan graphical API in your Android Player Settings.
     
    Lanre likes this.
  22. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    You have to pay attention to what clocks your different sources are on. For hardware time, a good clock is System.Diagnostics.Stopwatch.GetTimestamp.
     
  23. DamirS

    DamirS

    Joined:
    Aug 28, 2013
    Posts:
    15
    Hi all,

    we re developing on Android and use NATCam(2.3) together with NATCorder (1.62). The Issue with choppy and unusable recordings is bugging us aswell. It doesnt matter which resolution :/ Tested on S7 Edge in FHD.
    We re using Unity 2019.2.5f1 and targeting Api level min 24.
    I read this is a 1.62 issue ? What can we do ?

    yours
    Damir
     
  24. andrewdecker

    andrewdecker

    Joined:
    Jul 12, 2019
    Posts:
    15
    This issue was replicated with the latest version, 1.6.2, released on September 16, 2019. I see no version update available beyond that at the moment
     
  25. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Can you share your recording code?
     
  26. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Does this happen on the macOS or Windows editor?
     
  27. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    The iOS color inversion issue has been fixed. NatCorder 1.6.3 update will be live in a few days.
     
  28. andrewdecker

    andrewdecker

    Joined:
    Jul 12, 2019
    Posts:
    15
    Mac OS editor
     
  29. mtalbott

    mtalbott

    Joined:
    Dec 21, 2011
    Posts:
    107
    For anyone trying to use NatCorder with Vuforia:

    After weeks... months... of having choppy recording on Android I decided to switch my Vuforia Camera Device Mode from "MODE_OPTIMIZE_QUALITY" to "MODE_DEFAULT" and viola, recording and playback is smooth. No other changes. God I hate Vuforia. No clear documentation on what the hell "Camera Device Mode" even does.
     
    Lanre likes this.
  30. DamirS

    DamirS

    Joined:
    Aug 28, 2013
    Posts:
    15
    Sure but its quite identical to your sample provided.

    Damir
     

    Attached Files:

  31. NaijaNY82

    NaijaNY82

    Joined:
    Mar 7, 2017
    Posts:
    4
    Purchased Natcorder to use with Vuforia. Having similar issues as others. Works in the Unity editor on windows but doesn’t work properly on mobile. Hanging issues after preview. Black screen/ black video etc. Tried various solutions that were posted but none helped

    Does anyone have a working project file using Natcorder ReplayCam with Vuforia that they can share or point to?

    Will there be a vuforia or similar AR example included with Natcorder in the future?
     
  32. DamirS

    DamirS

    Joined:
    Aug 28, 2013
    Posts:
    15
    As a side note - on S7 Edge and Mate 20 pro the recordings are bad. On a sony xperia xz1 compact its smooth at FullHD. The same App o_O
    Any Ideas ?
     
  33. nikosurfing

    nikosurfing

    Joined:
    Mar 11, 2014
    Posts:
    43
    Can you be more specific? Bad like what?
    What version of natcorder?
    I've jittering / stutter / jank / freeze issues on the 1.6.2
     
  34. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    So first I need to isolate this to either NatCam or NatCorder. Can you reproduce the jerkiness on these devices with the ReplayCam example?
     
  35. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Email me with your invoice number. I have an updated build that fixes the blank video issue.
     
  36. CorstiaanMediamonks

    CorstiaanMediamonks

    Joined:
    Sep 14, 2015
    Posts:
    21
    Hi Lanre, any news on the release of your 1.6.3 update? We kind of need the color-fix as we're using NatCorder actively. Rolling back releases is a pain since you've changed the API and inner workings of the plugin quite severely.
     
  37. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Email me for the build.
     
  38. poshaughnessey

    poshaughnessey

    Joined:
    Jul 12, 2012
    Posts:
    40
    We are noticing a significant warm-up delay when using 1.6.2 NatCorder on iOS. At the start of the recording, the screen will freeze up for about 1-2 seconds, which also ends up recording to the video. After this warm-up, recording happens fine. We don't experience this delay in starting on Android.
     
  39. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    This lag is opaque to our code. It seems that the encoder has to warm up, but we don't control this in any way. One thing you could do is to create and dispose of an MP4Recorder when your scene loads (so it will go unnoticed).
     
  40. CorstiaanMediamonks

    CorstiaanMediamonks

    Joined:
    Sep 14, 2015
    Posts:
    21
    Has anyone been able to get audio recording working? It crashes hard on Android.
    Using this code:

    Code (CSharp):
    1.         private void OnAudioFilterRead(float[] data, int channels)
    2.         {
    3.             // audio params of MP4Recorder: ... AudioSettings.outputSampleRate, 2...
    4.             if (_hasAudio) videoRecorder?.CommitSamples(data, clock.Timestamp);
    5.         }
    6.  
    10/04 13:09:33.383 15357 15674 Error CRASH: signal 6 (SIGABRT), code -6 (?), fault addr --------
    10/04 13:09:33.384 15357 15674 Error CRASH: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    10/04 13:09:33.384 15357 15674 Error CRASH: Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    10/04 13:09:33.384 15357 15674 Error CRASH: Build fingerprint: 'samsung/crownltexx/crownlte:9/PPR1.180610.011/N960FXXU3CSI3:user/release-keys'
    10/04 13:09:33.384 15357 15674 Error CRASH: Revision: '28'
    10/04 13:09:33.384 15357 15674 Error CRASH: pid: 15357, tid: 15674, name: Thread-17 >>> com.mediamonks.octagon <<<
    10/04 13:09:33.384 15357 15674 Error CRASH: x0 0000000000000000 x1 0000000000003d3a x2 0000000000000006 x3 0000000000000008
    10/04 13:09:33.384 15357 15674 Error CRASH: x4 fefeff786c56b667 x5 fefeff786c56b667 x6 fefeff786c56b667 x7 7f7f7f7f7f7fff7f
    10/04 13:09:33.384 15357 15674 Error CRASH: x8 0000000000000083 x9 000000796b43b890 x10 fffffff87ffffbdf x11 0000000000000001
    10/04 13:09:33.384 15357 15674 Error CRASH: x12 ffffffffffffefff x13 ffffffffffffffff x14 ffffffffff000000 x15 ffffffffffffffff
    10/04 13:09:33.384 15357 15674 Error CRASH: x16 000000796b4722b0 x17 000000796b3b1958 x18 00000078e47d768a x19 0000000000003bfd
    10/04 13:09:33.384 15357 15674 Error CRASH: x20 0000000000003d3a x21 0000000000000083 x22 000000789ddb5800 x23 00000078b3fe58c0
    10/04 13:09:33.384 15357 15674 Error CRASH: x24 0000000000000000 x25 00000078e47d9588 x26 0000000000000000 x27 000000796dee9374
    10/04 13:09:33.384 15357 15674 Error CRASH: x28 00000078e47d9588 x29 00000078e47d8410 x30 000000796b3a4da0
    10/04 13:09:33.384 15357 15674 Error CRASH: sp 00000078e47d83d0 pc 000000796b3a4dcc pstate 0000000060000000
    10/04 13:09:33.384 15357 15674 Error CRASH:
    10/04 13:09:33.384 15357 15674 Error CRASH: backtrace:
    10/04 13:09:33.385 15357 16543 Verbose Unity: NatCorder: MP4 video encoder changed output format: {max-bitrate=5909760, vendor.sec-ext-enc-qp-range.B-minQP=5, vendor.rtc-ext-enc-low-latency.enable=0, mime=video/avc, vendor.sec-ext-enc-qp-range.P-minQP=5, bitrate=5909760, vendor.rtc-ext-enc-sar.height=0, color-standard=1, vendor.rtc-ext-enc-sar.width=0, color-transfer=3, vendor.rtc-ext-enc-caps-temporal-layers.max-p-count=7, vendor.rtc-ext-enc-base-layer-pid=0, vendor.sec-ext-enc-qp-range.I-minQP=5, color-range=2, vendor.rtc-ext-enc-caps-preprocess.rotation=0, frame-rate=30, height=720, vendor.sec-ext-enc-qp-range.B-maxQP=50, vendor.rtc-ext-enc-custom-profile-level.level=1, vendor.rtc-ext-enc-caps-preprocess.max-downscale-factor=0, opaque_handle=0, vendor.rtc-ext-enc-ltr-count.num-ltr-frames=0, csd-1=java.nio.HeapByteBuffer[pos=0 lim=8 cap=8], vendor.sec-ext-enc-qp-range.I-maxQP=50, vendor.sec-ext-enc-qp-range.P-maxQP=50, vendor.rtc-ext-enc-caps-vt-driver-version.number=180315, width=1280, vendor.rtc-ext-enc-caps-temporal-layers.max-b-count=6, vendor.rtc-ext-enc-custom-profile-level.profile=1, vendor.rtc-ext-enc-caps-ltr.max-count=4, vendor.rtc-ext-enc-slice.spacing=0, csd-0=java.nio.HeapByteBuffer[pos=0 lim=18 cap=18]}
    10/04 13:09:33.388 15357 16550 Info MPEG4Writer: setStartTimestampUs: 0 from Audio track
    10/04 13:09:33.388 15357 16550 Info MPEG4Writer: Earliest track starting time: 0
    10/04 13:09:33.390 15357 16551 Debug MPEG4Writer: Video skip non-key frame
    10/04 13:09:33.390 15357 16531 Info MediaCodec: setCodecState state : 1
    10/04 13:09:33.394 15357 16551 Info MPEG4Writer: setStartTimestampUs: 88755 from Video track
    10/04 13:09:33.410 15357 15674 Error CRASH: #00 pc 000000000000069c [vdso] ()
    10/04 13:09:33.410 15357 15674 Error CRASH: #01 pc 0000000000021dc8 /system/lib64/libc.so (abort+120)
    10/04 13:09:33.410 15357 15674 Error CRASH: #02 pc 00000000004486d8 /system/lib64/libart.so (_ZN3art7Runtime5AbortEPKc+1208)
    10/04 13:09:33.410 15357 15674 Error CRASH: #03 pc 0000000000008d2c /system/lib64/libbase.so (_ZN7android4base10LogMessageD1Ev+724)
    10/04 13:09:33.410 15357 15674 Error CRASH: #04 pc 000000000021e55c /system/lib64/libart.so (_ZN3art22IndirectReferenceTable17AbortIfNoCheckJNIERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE+244)
    10/04 13:09:33.410 15357 15674 Error CRASH: #05 pc 00000000002cc698 /system/lib64/libart.so (_ZNK3art22IndirectReferenceTable10GetCheckedEPv+432)
    10/04 13:09:33.410 15357 15674 Error CRASH: #06 pc 00000000004797d4 /system/lib64/libart.so (_ZNK3art6Thread13DecodeJObjectEP8_jobject+100)
    10/04 13:09:33.411 15357 15674 Error CRASH: #07 pc 0000000000441c20 /system/lib64/libart.so (_ZN3art12_GLOBAL__N_18ArgArray24BuildArgArrayFromJValuesERKNS_33ScopedObjectAccessAlreadyRunnableENS_6ObjPtrINS_6mirror6ObjectEEEP6jvalue+208)
    10/04 13:09:33.411 15357 15674 Error CRASH: #08 pc 0000000000441a10 /system/lib64/libart.so (_ZN3art17InvokeWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDP6jvalue+384)
    10/04 13:09:33.411 15357 15674 Error CRASH: #09 pc 000000000033785c /system/lib64/libart.so (_ZN3art3JNI23CallStaticObjectMethodAEP7_JNIEnvP7_jclassP10_jmethodIDP6jvalue+636)
    10/04 13:09:33.411 15357 15674 Error CRASH: #10 pc 00000000003387a0 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libunity.so () (Addr2Line failure)
    10/04 13:09:33.411 15357 15674 Error CRASH: #11 pc 000000000033d7f8 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libunity.so () (Addr2Line failure)
    10/04 13:09:33.411 15357 15674 Error CRASH: #12 pc 000000000199ff0c /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libil2cpp.so ()
    10/04 13:09:33.411 15357 15674 Error CRASH: #13 pc 00000000019a5a20 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libil2cpp.so ()
    10/04 13:09:33.411 15357 15674 Error CRASH: #14 pc 000000000199c658 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libil2cpp.so ()
    10/04 13:09:33.411 15357 15674 Error CRASH: #15 pc 00000000019a2da8 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libil2cpp.so ()
    10/04 13:09:33.411 15357 15674 Error CRASH: #16 pc 00000000019f837c /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libil2cpp.so ()
    10/04 13:09:33.411 15357 15674 Error CRASH: #17 pc 0000000000819390 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libil2cpp.so ()
    10/04 13:09:33.411 15357 15674 Error CRASH: #18 pc 000000000090e790 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libil2cpp.so ()
    10/04 13:09:33.411 15357 15674 Error CRASH: #19 pc 0000000000647e2c /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libunity.so () (Addr2Line failure)
    10/04 13:09:33.411 15357 15674 Error CRASH: #20 pc 00000000006548d0 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libunity.so () (Addr2Line failure)
    10/04 13:09:33.411 15357 15674 Error CRASH: #21 pc 00000000003e8dc8 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libunity.so () (Addr2Line failure)
    10/04 13:09:33.411 15357 15674 Error CRASH: #22 pc 0000000000fcdc24 /data/app/com.mediamonks.octagon-0CL9t2vpbcUeBLt2Pk50tw==/lib/arm64/libunity.so () (Addr2Line failure)
    10/04 13:09:33.424 15357 15445 Error CRASH: other thread is trapped; signum = 6
    01/01 00:00:00.000 -1 -1 Info : --------- beginning of crash
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: FATAL EXCEPTION: UnityMain
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: Process: com.mediamonks.octagon, PID: 15357
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: java.lang.Error: signal 6 (SIGABRT), code -6 (?), fault addr --------
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: Build fingerprint: 'samsung/crownltexx/crownlte:9/PPR1.180610.011/N960FXXU3CSI3:user/release-keys'
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: Revision: '28'
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: pid: 15357, tid: 15674, name: Thread-17 >>> com.mediamonks.octagon <<<
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: x0 0000000000000000 x1 0000000000003d3a x2 0000000000000006 x3 0000000000000008
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: x4 fefeff786c56b667 x5 fefeff786c56b667 x6 fefeff786c56b667 x7 7f7f7f7f7f7fff7f
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: x8 0000000000000083 x9 000000796b43b890 x10 fffffff87ffffbdf x11 0000000000000001
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: x12 ffffffffffffefff x13 ffffffffffffffff x14 ffffffffff000000 x15 ffffffffffffffff
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: x16 000000796b4722b0 x17 000000796b3b1958 x18 00000078e47d768a x19 0000000000003bfd
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: x20 0000000000003d3a x21 0000000000000083 x22 000000789ddb5800 x23 00000078b3fe58c0
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: x24 0000000000000000 x25 00000078e47d9588 x26 0000000000000000 x27 000000796dee9374
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: x28 00000078e47d9588 x29 00000078e47d8410 x30 000000796b3a4da0
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: sp 00000078e47d83d0 pc 000000796b3a4dcc pstate 0000000060000000
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime:
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at [vdso].:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libc.abort(abort:120)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libart._ZN3art7Runtime5AbortEPKc(_ZN3art7Runtime5AbortEPKc:1208)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libbase._ZN7android4base10LogMessageD1Ev(_ZN7android4base10LogMessageD1Ev:724)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libart._ZN3art22IndirectReferenceTable17AbortIfNoCheckJNIERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE(_ZN3art22IndirectReferenceTable17AbortIfNoCheckJNIERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:244)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libart._ZNK3art22IndirectReferenceTable10GetCheckedEPv(_ZNK3art22IndirectReferenceTable10GetCheckedEPv:432)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libart._ZNK3art6Thread13DecodeJObjectEP8_jobject(_ZNK3art6Thread13DecodeJObjectEP8_jobject:100)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libart._ZN3art12_GLOBAL__N_18ArgArray24BuildArgArrayFromJValuesERKNS_33ScopedObjectAccessAlreadyRunnableENS_6ObjPtrINS_6mirror6ObjectEEEP6jvalue(_ZN3art12_GLOBAL__N_18ArgArray24BuildArgArrayFromJValuesERKNS_33ScopedObjectAccessAlreadyRunnableENS_6ObjPtrINS_6mirror6ObjectEEEP6jvalue:208)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libart._ZN3art17InvokeWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDP6jvalue(_ZN3art17InvokeWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDP6jvalue:384)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libart._ZN3art3JNI23CallStaticObjectMethodAEP7_JNIEnvP7_jclassP10_jmethodIDP6jvalue(_ZN3art3JNI23CallStaticObjectMethodAEP7_JNIEnvP7_jclassP10_jmethodIDP6jvalue:636)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libunity.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libunity.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libil2cpp.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libil2cpp.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libil2cpp.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libil2cpp.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libil2cpp.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libil2cpp.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libil2cpp.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libunity.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libunity.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libunity.:)0)
    10/04 13:09:33.425 15357 15445 Error AndroidRuntime: at libunity.:)0)
    10/04 13:09:33.426 15357 15960 Error CRASH: other thread is trapped; signum = 6
    10/04 13:09:33.426 15357 15960 Error CRASH: main thread is trapped; signum = 6
    10/04 13:09:33.426 15357 15960 Error CRASH: other thread is trapped; signum = 6
    10/04 13:09:33.460 15357 15960 Error CRASH: main thread is trapped; signum = 6
    10/04 13:09:33.460 15357 15960 Error CRASH: other thread is trapped; signum = 6
     
  41. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Make sure that the JNI is attached to the audio thread if the audio thread isn't attached. Call AndroidJNI.AttachCurrentThread before calling CommitSamples.
     
    CorstiaanMediamonks likes this.
  42. CorstiaanMediamonks

    CorstiaanMediamonks

    Joined:
    Sep 14, 2015
    Posts:
    21
    Awesome that works, thnx!
     
    Lanre likes this.
  43. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    308
    I use NatRecorder for both iOS and Android recording AR scene (ARFoundation)
    Testing it on iOS on iPhone7 (what is pretty weak) I don't have any lags and issues but on Android top model Xiaomi model Redmi K20 Pro I got terrific lags playing the recorded video just after it's completed. I am using standard Unity VideoPalyer, profiling I didn't find any issue, VideoPlayer.Update takes just 0.2ms...

    A bit confused... I don't use the microphone at all, so recording without audio, and resizing video size to 720p
     
  44. CorstiaanMediamonks

    CorstiaanMediamonks

    Joined:
    Sep 14, 2015
    Posts:
    21
    Will the RenderTextureInput return in next update? We're kinda using it. I'm trying to implement myself but I guess you removed IAbstractRecorder for a reason? You still have problems with glReadPixels?
     
  45. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    NatCorder doesn't have anything to do with video playback, so you'll have to reach out to Unity on this one.
     
  46. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    What version are you using? If you're on the Asset Store version (1.6.2), then RenderTextureInput is there. In the upcoming 1.6.3 update, we've replaced it with implementations of the IReadback class. See the CameraInput source for how it is used.
     
  47. CorstiaanMediamonks

    CorstiaanMediamonks

    Joined:
    Sep 14, 2015
    Posts:
    21
    I'm currently using 1.6.3b which you so gracefully supplied to fix the iOS color issue.
    I'll try the readback code from CameraInput

    thnx for keeping an eye on this forum, much appreciated!
     
  48. CorstiaanMediamonks

    CorstiaanMediamonks

    Joined:
    Sep 14, 2015
    Posts:
    21
    well now I've got this:

    10/04 17:28:12.571 29393 29440 Error Unity: AndroidJavaException: java.lang.OutOfMemoryError: Failed to allocate a 9590416 byte allocation with 762072 free bytes and 744KB until OOM, max allowed footprint 268435456, growth limit 268435456
    10/04 17:28:12.571 29393 29440 Error Unity: java.lang.OutOfMemoryError: Failed to allocate a 9590416 byte allocation with 762072 free bytes and 744KB until OOM, max allowed footprint 268435456, growth limit 268435456
    10/04 17:28:12.571 29393 29440 Error Unity: at com.olokobayusuf.natcorder.MP4Recorder.encodeFrame(MP4Recorder.java:137)
    10/04 17:28:12.571 29393 29440 Error Unity: at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native Method)
    10/04 17:28:12.571 29393 29440 Error Unity: at com.unity3d.player.ReflectionHelper.a(Unknown Source:0)
    10/04 17:28:12.571 29393 29440 Error Unity: at com.unity3d.player.ReflectionHelper$1.invoke(Unknown Source:31)
    10/04 17:28:12.571 29393 29440 Error Unity: at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
    10/04 17:28:12.571 29393 29440 Error Unity: at $Proxy11.onReadback(Unknown Source)
    10/04 17:28:12.571 29393 29440 Error Unity: at com.olokobayusuf.natcorder.readback.GLESReadback$4.onImageAvailable(GLESReadback.java:116)


    and

    10/04 17:28:12.762 29393 29440 Error Unity: AndroidJavaException: java.lang.OutOfMemoryError: Failed to allocate a 9590419 byte allocation with 309736 free bytes and 302KB until OOM, max allowed footprint 268435456, growth limit 268435456
    10/04 17:28:12.762 29393 29440 Error Unity: java.lang.OutOfMemoryError: Failed to allocate a 9590419 byte allocation with 309736 free bytes and 302KB until OOM, max allowed footprint 268435456, growth limit 268435456
    10/04 17:28:12.762 29393 29440 Error Unity: at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    10/04 17:28:12.762 29393 29440 Error Unity: at java.nio.DirectByteBuffer$MemoryRef.<init>(DirectByteBuffer.java:71)
    10/04 17:28:12.762 29393 29440 Error Unity: at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:257)
    10/04 17:28:12.762 29393 29440 Error Unity: at com.olokobayusuf.natcorder.readback.GLESReadback.readback(GLESReadback.java:74)


    and

    10/04 17:28:12.994 29393 29440 Error Unity: AndroidJavaException: java.lang.OutOfMemoryError: Failed to allocate a 9590416 byte allocation with 281472 free bytes and 274KB until OOM, max allowed footprint 268435456, growth limit 268435456
    10/04 17:28:12.994 29393 29440 Error Unity: java.lang.OutOfMemoryError: Failed to allocate a 9590416 byte allocation with 281472 free bytes and 274KB until OOM, max allowed footprint 268435456, growth limit 268435456
    10/04 17:28:12.994 29393 29440 Error Unity: at com.olokobayusuf.natcorder.MP4Recorder.encodeFrame(MP4Recorder.java:137)
    10/04 17:28:12.994 29393 29440 Error Unity: at com.unity3d.player.ReflectionHelper.nativeProxyInvoke(Native Method)
    10/04 17:28:12.994 29393 29440 Error Unity: at com.unity3d.player.ReflectionHelper.a(Unknown Source:0)
    10/04 17:28:12.994 29393 29440 Error Unity: at com.unity3d.player.ReflectionHelper$1.invoke(Unknown Source:31)
    10/04 17:28:12.994 29393 29440 Error Unity: at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
    10/04 17:28:12.994 29393 29440 Error Unity: at $Proxy11.onReadback(Unknown Source)
    10/04 17:28:12.994 29393 29440 Error Unity: at com.olokobayusuf.natcorder.readback.GLESReadback$4.onImageAvailable(GLESReadback.java:116)


    any ideas? Or should I just revert your plugin to a few versions ago?
     
  49. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    2,617
    Can you share your recording code? You're probably leaking memory.
     
  50. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    308
    Sure, that's clear. I have just been wondering maybe I can decrease recorded video quality somehow, to make a playback less laggy?