Search Unity

NatCorder - Video Recording API

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

  1. Lanre

    Lanre

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

    rumit48

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

    LeeLorenzSr

    Joined:
    May 3, 2015
    Posts:
    50
    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.
     
  4. nikosurfing

    nikosurfing

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

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    518
    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
  6. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    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
     
  7. nikosurfing

    nikosurfing

    Joined:
    Mar 11, 2014
    Posts:
    45
    @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?
     
  8. Bongo_Studios

    Bongo_Studios

    Joined:
    Jan 26, 2019
    Posts:
    33
    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.
     
  9. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I'm working on fixing this. Sorry for the delay.
     
  10. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    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".
     
  11. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Email me to test a build that should fix this.
     
  12. PavanJ

    PavanJ

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

    andrewdSuper77

    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
     
  14. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    We don't develop for UWP.
     
  15. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Upgrade to the latest version of NatCorder on the Asset Store. This issue has been fixed.
     
  16. 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
     
  17. Lanre

    Lanre

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

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    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.
     
  19. LeeLorenzSr

    LeeLorenzSr

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

    Lanre

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

    DamirS

    Joined:
    Aug 28, 2013
    Posts:
    19
    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
     
  22. andrewdSuper77

    andrewdSuper77

    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
     
  23. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Can you share your recording code?
     
  24. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Does this happen on the macOS or Windows editor?
     
  25. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    The iOS color inversion issue has been fixed. NatCorder 1.6.3 update will be live in a few days.
     
  26. andrewdSuper77

    andrewdSuper77

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

    mtalbott

    Joined:
    Dec 21, 2011
    Posts:
    125
    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.
  28. DamirS

    DamirS

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

    Damir
     

    Attached Files:

  29. NaijaNY82

    NaijaNY82

    Joined:
    Mar 7, 2017
    Posts:
    19
    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?
     
  30. DamirS

    DamirS

    Joined:
    Aug 28, 2013
    Posts:
    19
    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 ?
     
  31. nikosurfing

    nikosurfing

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

    Lanre

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

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Email me with your invoice number. I have an updated build that fixes the blank video issue.
     
  34. 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.
     
  35. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Email me for the build.
     
  36. poshaughnessey

    poshaughnessey

    Joined:
    Jul 12, 2012
    Posts:
    45
    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.
     
  37. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    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).
     
  38. 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
     
  39. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    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.
  40. CorstiaanMediamonks

    CorstiaanMediamonks

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

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    518
    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
     
  42. 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?
     
  43. Lanre

    Lanre

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

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    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.
     
  45. 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!
     
  46. 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?
     
  47. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Can you share your recording code? You're probably leaking memory.
     
  48. novaVision

    novaVision

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

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    You can try reducing the resolution, but again this is no guarantee. Reach out to Unity on the lag.
     
  50. kkiruk

    kkiruk

    Joined:
    Sep 7, 2015
    Posts:
    8
    I've been using NatCorder 1.3f3 well, but at this time Google 64bit policy, I'm trying to update NatCorder.

    At 1.3f3, I can set the movie size like this,
    Code (CSharp):
    1. videoFormat = new VideoFormat((int)(width), (int)(height), 30);
    And get the same view what I see on screen.


    But I don't know how to do it at the latest version.
    I see the ReplayCam.cs and I think these lines are as same function as above.
    Code (CSharp):
    1. videoRecorder = new MP4Recorder(
    2.                 videoWidth,
    3.                 videoHeight,
    4.                 30,
    5.                 recordMicrophone ? AudioSettings.outputSampleRate : 0,
    6.                 recordMicrophone ? (int)AudioSettings.speakerMode : 0,
    7.                 OnReplay
    8.             );
    9. // Create recording inputs
    10. cameraInput = new CameraInput(videoRecorder, recordingClock, Camera.main);
    But when I use as same width, height value as 1.3f3 version at "videoWidth, videoHeight", it gives me different result.
    The file resolution size is "videoWidth x videoHeight", but the movie is much zoom out then what I see on screen!

    Can you help me?