Search Unity

NatCorder - Video Recording API

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

  1. GrooveJones

    GrooveJones

    Joined:
    Aug 19, 2016
    Posts:
    11
    Does the move function move or copy the file? does it only record one file and overwrite?
     
  2. renboxue

    renboxue

    Joined:
    Jul 12, 2014
    Posts:
    6
    Hello everyone,I found the NatCorder can‘t work at some devices,for example,ipad MD513CH/A,ios 8.4.1(12H321).
    When I use the 1.6.1 version,it can record the video file to mov successfully,but it didn't call the SaveCallback function.
    Then I update the plugin to NatCorder 1.2f2(the lastest version),but it totally didn't work at this device,even the ReplayCam example.

    Please help me,how to fix this issue,or if I can have a list of those devices it don't support.
     
  3. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    NatCorder is a video recorder. As such, it does not have anything to do with barcode detection.
     
  4. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    I'm not sure what you mean by reference. Look up the function on MSDN as it is provided by the .NET framework.
     
  5. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    The Move function is provided by .NET. You can find more information about it here.
     
  6. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Can you share the logs from Xcode? NatCorder doesn't have a blacklist because all devices that have the minimum supported OS version can run it.
     
  7. niv_onehamsa

    niv_onehamsa

    Joined:
    Oct 30, 2016
    Posts:
    13
    Hi again,

    We're developing an iOS app that needs to record video while playing back another video (using Unity's videoPlayer component). It seems like existing video players (that were already playing when recording started) are paused/stopped (though their audio remains). I can start new video players and they play nice with the recorder. Have you ever run into similar issues? any advice?

    The only other bit of info I see in the xcode debug log is this werid message:
    2018-07-26 16:29:07.866040+0300 *******[16903:2170850] [avas] AVAudioSession.mm:1142:-[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.

    And lastly, I noticed this discussion and might have some useful info:

    IS this referring to an oleaut32.dll crash on windows7?

    I was trying to get some work done from an older PC I have with windows7 and started to get those crashes. After some intensive googling I found a workaround so i can develop on Win7 without crashes (its a mobile app - so windows is just a dev OS).

    If you run the unity editor using compatibility mode to windows Vista SP2 it stops crashing ... although windows 7 seems to not generate valid video files for arbitrary resolutions. It only 'likes' common ones (which I found weird).
     
  8. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    I haven't faced this before. I'd recommend sending in a bug report to Unity.
    It absolutely is. Thanks for this useful piece of information. @TobiasW you might find this useful.
     
  9. Area51audiovisuales

    Area51audiovisuales

    Joined:
    Jul 26, 2018
    Posts:
    2
    Hello Friend. I am an amateur developer, I have almost no knowledge in programming or script language, I work in the animation area and I am currently working on an AR (Augmented Reality with Vuforia) project. I want to buy the Natcoder. But before I had a question, is there a video tutorial on how to use the natcoder with vuforia? I'm afraid to buy it and not know how to use it and lose money lol. I await an answer. My e-mail area51audiovisuales@gmail.com (English translated from Spanish by google)
     
  10. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Hi there. I responded to you on Medium.
     
  11. renboxue

    renboxue

    Joined:
    Jul 12, 2014
    Posts:
    6
    Thank you for your response,this is the log of Xcode.
    In the ReplayCam example,when I press the recorder button,the application will crash and freezing for few seconds,and then a crash log showed.

    2018-07-27 09:10:10.309 ProductName[5886:878598] -> registered mono modules 0x9293b0

    -> applicationDidFinishLaunching()

    Player data archive not found at `/private/var/mobile/Containers/Bundle/Application/75DCF37F-6220-45AA-BFA2-508CC38F505D/ProductName.app/Data/data.unity3d`, using local filesystem

    2018-07-27 09:10:11.170 ProductName[5886:878598] Metal GPU Frame Capture Enabled

    2018-07-27 09:10:11.171 ProductName[5886:878598] Metal API Validation Disabled

    -> applicationDidBecomeActive()

    Renderer: PowerVR SGX 554

    Vendor: Imagination Technologies

    Version: OpenGL ES 2.0 IMGSGX554-115.5

    GLES: 2

    GL_OES_depth_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_clip_distance GL_APPLE_color_buffer_packed_float GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_APPLE_texture_packed_float GL_IMG_read_format GL_IMG_texture_comp

    ression_pvrtc

    OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level <OpenGL ES 2.0> ; Context handle 349247968

    Initialize engine version: 2017.2.0f3 (46dda1414e51)

    -------- Shader compilation failed

    #version 100

    #extension GL_EXT_frag_depth : enable

    precision highp float;

    uniform highp vec4 _ProjectionParams;

    uniform highp vec4 _ZBufferParams;

    uniform highp mat4 unity_CameraToWorld;

    uniform highp mat4 _NonJitteredVP;

    uniform highp mat4 _PreviousVP;

    uniform highp sampler2D _CameraDepthTexture;

    varying highp vec2 xlv_TEXCOORD0;

    varying highp vec3 xlv_TEXCOORD1;

    void main ()

    {

    highp vec4 tmpvar_1;

    tmpvar_1 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0);

    mediump vec2 tmpvar_2;

    highp vec4 tmpvar_3;

    tmpvar_3.w = 1.0;

    tmpvar_3.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((

    (_ZBufferParams.x * tmpvar_1.x)

    + _ZBufferParams.y))));

    highp vec4 tmpvar_4;

    tmpvar_4 = (unity_CameraToWorld * tmpvar_3);

    highp vec4 tmpvar_5;

    tmpvar_5 = (_PreviousVP * tmpvar_4);

    highp vec4 tmpvar_6;

    tmpvar_6 = (_NonJitteredVP * tmpvar_4);

    highp vec2 tmpvar_7;

    tmpvar_7 = (((tmpvar_5.xy / tmpvar_5.w) + 1.0) / 2.0);

    highp vec2 tmpvar_8;

    tmpvar_8 = (((tmpvar_6.xy / tmpvar_6.w) + 1.0) / 2.0);

    tmpvar_2 = (tmpvar_8 - tmpvar_7);

    mediump vec4 tmpvar_9;

    tmpvar_9.zw = vec2(0.0, 1.0);

    tmpvar_9.xy = tmpvar_2;

    gl_FragDepthEXT = tmpvar_1.x;

    gl_FragData[0] = tmpvar_9;

    }

    -------- failed compiling:

    fragment evaluation shader

    WARNING: 0:4: extension 'GL_EXT_frag_depth' is not supported

    ERROR: 0:38: Use of undeclared identifier 'gl_FragDepthEXT'



    Note: Creation of internal variant of shader 'Hidden/Internal-MotionVectors' failed.

    WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Hidden/Internal-MotionVectors' - Setting to default shader.

    -------- Shader compilation failed

    #version 100

    #extension GL_EXT_frag_depth : enable

    precision highp float;

    uniform sampler2D _MainTex;

    uniform highp sampler2D _DepthTex;

    uniform highp vec4 _Color;

    varying highp vec2 xlv_TEXCOORD0;

    void main ()

    {

    lowp vec4 tmpvar_1;

    tmpvar_1 = (texture2D (_MainTex, xlv_TEXCOORD0) * _Color);

    gl_FragDepthEXT = texture2D (_DepthTex, xlv_TEXCOORD0).x;

    gl_FragData[0] = tmpvar_1;

    }

    -------- failed compiling:

    fragment evaluation shader

    WARNING: 0:4: extension 'GL_EXT_frag_depth' is not supported

    ERROR: 0:14: Use of undeclared identifier 'gl_FragDepthEXT'



    Note: Creation of internal variant of shader 'Hidden/BlitCopyWithDepth' failed.

    WARNING: Shader Unsupported: 'Hidden/BlitCopyWithDepth' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Hidden/BlitCopyWithDepth' - Setting to default shader.

    WARNING: Shader Unsupported: 'Hidden/VR/BlitTexArraySlice' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Hidden/VR/BlitTexArraySlice' - Setting to default shader.

    Setting up 1 worker threads for Enlighten.

    Thread -> id: 6938000 -> priority: 1

    UnloadTime: 1.194125 ms

    NatCorder: Initialized NatCorder 1.2 iOS backend

    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])

    UnityEngine.Logger:Log(LogType, Object)

    UnityEngine.Debug:Log(Object)

    NatCorderU.Core.NatCorder:.cctor()

    NatCorderU.Core.Replay:StartRecording(Camera, Configuration, VideoCallback, IAudioSource)

    NatCorderU.Examples.ReplayCam:StartRecording()

    UnityEngine.Events.UnityEvent:Invoke()

    NatCamU.Examples.<Countdown>c__Iterator0:MoveNext()

    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)



    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)



    2018-07-27 09:10:35.553 ProductName[5886:878598] NatCorder: Prepared video track at resolution 1364x1024@30Hz with average bitrate 5909759 and keyframe interval 3s

    ProductName was compiled with optimization - stepping may behave oddly; variables may not be available.

    (lldb)



    ProductName`-[GLTransferContext createBuffer:height:]:

    0x8c1276 <+0>: push {r4, r5, r6, r7, lr}

    0x8c1278 <+2>: add r7, sp, #0xc

    0x8c127a <+4>: push.w {r8, r10, r11}

    0x8c127e <+8>: sub sp, #0x3c

    0x8c1280 <+10>: mov r4, r2

    0x8c1282 <+12>: mov r6, r3

    0x8c1284 <+14>: str r4, [sp, #0x8]

    0x8c1286 <+16>: movw r0, #0x3e02

    0x8c128a <+20>: movt r0, #0x18

    0x8c128e <+24>: movw r1, #0x652

    0x8c1292 <+28>: movt r1, #0x1d

    0x8c1296 <+32>: movw r8, #0x153e

    0x8c129a <+36>: movt r8, #0x1d

    0x8c129e <+40>: movw r2, #0x3d70

    0x8c12a2 <+44>: movt r2, #0x18

    0x8c12a6 <+48>: add r0, pc

    0x8c12a8 <+50>: add r2, pc

    0x8c12aa <+52>: add r1, pc

    0x8c12ac <+54>: ldr r0, [r0]

    0x8c12ae <+56>: add r8, pc

    0x8c12b0 <+58>: ldr r2, [r2]

    0x8c12b2 <+60>: ldr r1, [r1]

    0x8c12b4 <+62>: ldr r2, [r2]

    0x8c12b6 <+64>: str r2, [sp, #0x38]

    0x8c12b8 <+66>: ldr r2, [r0]

    0x8c12ba <+68>: ldr.w r0, [r8]

    0x8c12be <+72>: str r2, [sp, #0x10]

    0x8c12c0 <+74>: movw r2, #0x5241

    0x8c12c4 <+78>: movt r2, #0x4247

    0x8c12c8 <+82>: blx 0x8c50a8 ; symbol stub for: objc_msgSend

    0x8c12cc <+86>: mov r7, r7

    0x8c12ce <+88>: blx 0x8c5138 ; symbol stub for: objc_retainAutoreleasedReturnValue

    0x8c12d2 <+92>: mov r11, r0

    0x8c12d4 <+94>: movw r0, #0x3dcc

    0x8c12d8 <+98>: movt r0, #0x18

    0x8c12dc <+102>: movw r1, #0x572

    0x8c12e0 <+106>: add r0, pc

    0x8c12e2 <+108>: movt r1, #0x1d

    0x8c12e6 <+112>: add r1, pc

    0x8c12e8 <+114>: str.w r11, [sp, #0x24]

    0x8c12ec <+118>: ldr r0, [r0]

    0x8c12ee <+120>: ldr r5, [r1]

    0x8c12f0 <+122>: ldr r2, [r0]

    0x8c12f2 <+124>: ldr.w r0, [r8]

    0x8c12f6 <+128>: mov r1, r5

    0x8c12f8 <+130>: str r2, [sp, #0x14]

    0x8c12fa <+132>: mov r2, r4

    0x8c12fc <+134>: blx 0x8c50a8 ; symbol stub for: objc_msgSend

    0x8c1300 <+138>: mov r7, r7

    0x8c1302 <+140>: blx 0x8c5138 ; symbol stub for: objc_retainAutoreleasedReturnValue

    0x8c1306 <+144>: mov r4, r0

    0x8c1308 <+146>: movw r0, #0x3d86

    0x8c130c <+150>: movt r0, #0x18

    0x8c1310 <+154>: mov r2, r6

    0x8c1312 <+156>: add r0, pc

    0x8c1314 <+158>: str r4, [sp, #0x28]

    0x8c1316 <+160>: ldr r0, [r0]

    0x8c1318 <+162>: ldr r1, [r0]

    0x8c131a <+164>: ldr.w r0, [r8]

    0x8c131e <+168>: str r1, [sp, #0x18]

    0x8c1320 <+170>: mov r1, r5

    0x8c1322 <+172>: blx 0x8c50a8 ; symbol stub for: objc_msgSend

    0x8c1326 <+176>: mov r7, r7

    0x8c1328 <+178>: blx 0x8c5138 ; symbol stub for: objc_retainAutoreleasedReturnValue

    0x8c132c <+182>: mov r5, r0

    0x8c132e <+184>: movw r0, #0x3d6c

    0x8c1332 <+188>: movt r0, #0x18

    0x8c1336 <+192>: movs r2, #0x1

    0x8c1338 <+194>: add r0, pc

    0x8c133a <+196>: ldr r0, [r0]

    0x8c133c <+198>: ldr r0, [r0]

    0x8c133e <+200>: str r0, [sp, #0x1c]

    0x8c1340 <+202>: ldr.w r0, [r8]

    0x8c1344 <+206>: movw r1, #0x5b2

    0x8c1348 <+210>: movt r1, #0x1d

    0x8c134c <+214>: str r5, [sp, #0x2c]

    0x8c134e <+216>: add r1, pc

    0x8c1350 <+218>: ldr r1, [r1]

    0x8c1352 <+220>: blx 0x8c50a8 ; symbol stub for: objc_msgSend

    0x8c1356 <+224>: mov r7, r7

    0x8c1358 <+226>: blx 0x8c5138 ; symbol stub for: objc_retainAutoreleasedReturnValue

    0x8c135c <+230>: mov r8, r0

    0x8c135e <+232>: movw r0, #0x3d34

    0x8c1362 <+236>: movt r0, #0x18

    0x8c1366 <+240>: movs r2, #0x5

    0x8c1368 <+242>: add r0, pc

    0x8c136a <+244>: add r3, sp, #0x10

    0x8c136c <+246>: ldr r0, [r0]

    0x8c136e <+248>: ldr r0, [r0]

    0x8c1370 <+250>: str r0, [sp, #0x20]

    0x8c1372 <+252>: movw r0, #0xfa6e

    0x8c1376 <+256>: movt r0, #0x18

    0x8c137a <+260>: add r0, pc

    0x8c137c <+262>: ldr r0, [r0]

    -> 0x8c137e <+264>: ldr r0, [r0]

    0x8c1380 <+266>: str r0, [sp, #0x34]

    0x8c1382 <+268>: movw r0, #0x1466

    0x8c1386 <+272>: movt r0, #0x1d

    0x8c138a <+276>: add r0, pc

    0x8c138c <+278>: ldr r0, [r0]

    0x8c138e <+280>: movw r1, #0x4c4
     
  12. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    I needed to make sure this wasn't a memory issue; it isn't. Can you share a screenshot of the Xcode window when the crash happens? I want to see the call stack that triggers the crash. Also, please use code tags instead of pasting the logs directly into your response; not doing so makes the page harder to navigate.
     
  13. TobiasW

    TobiasW

    Joined:
    Jun 18, 2011
    Posts:
    91
    Alright. Thanks for dealing with this!

    I finally managed to implement this - works fine. And just as I was hoping, there's a pretty good improvement in audio quality when commiting the whole Microphone AudioClip at the end instead of realtime.

    Oh, nice. I'm taking a break from the project now, but I'm looking forward to try that when I'm back!

    Thanks for all your help so far, much appreciated!
     
    Lanre likes this.
  14. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    is NatCorder compatible with NatCam's zxing? Had thought NatCorder was to replace the previous NatCam series?
     
  15. renboxue

    renboxue

    Joined:
    Jul 12, 2014
    Posts:
    6
    Thanks for your response,this is the screenshot,and I don't think it's a memory issue.This is the 1.2f2 version's result,and in the 1.6 NatCam Pro,it can record a .mov file on the device,but didn't call the SaveCallBack function.Only this device has the issue,it works well at my other devices.So I think is not a memory issue.
     

    Attached Files:

  16. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    NatCorder doesn't replace NatCam. NatCam handles using device cameras (webcams), whereas NatCorder handles recording videos. A lot of developers (including us) use both of them together.

    NatCam doesn't have Zxing. We removed barcode and face detection from NatCam a long time ago.
     
    ina likes this.
  17. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    How are you able to mount the device's file system on your computer? Is the device jailbroken? Also, make sure that if NatCam is also in your project, it is the latest NatCam. NatCorder and NatCam share a library, and you need to make sure they are the same version by using only the latest versions of both libraries. You are correct that this issue is specific to the device. The source for the function that causes the crash doesn't have anything that would crash the app, so it must be that something is wrong with the implementation of the native libraries being used.
     
  18. renboxue

    renboxue

    Joined:
    Jul 12, 2014
    Posts:
    6
    The device didn't jailbroken,Xcode can download the container form the device to Mac.
    In my test project,there is only the NatCorder example(latest version),and it works in then editor,you can see it in the screenshot,there is a .mov file recorded.

    But now I prefer use the 1.6 version,please tell me,what can I do let the SaveCallBack function called,or if there has other method to get the recorded file's path?
     

    Attached Files:

  19. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    I need to clarify this: are you using NatCorder and NatCam, or only NatCorder? NatCorder doesn't have a SaveCallback, and the latest version is 1.2. As for NatCam, we removed video recording from it in the latest version. If you are also using NatCam, then you have to upgrade to the latest version.
     
  20. niv_onehamsa

    niv_onehamsa

    Joined:
    Oct 30, 2016
    Posts:
    13
    I will at some point. Though I've found some workarounds for the time being.

    That said, I'm facing another issue that might be workable on your end. I'm getting some weird memory leak issues.
    The first symptoms were app crashes with the obscure message "Message from debugger: terminated due to memory issue". I used the memory watch thing in xcode's debug navigator and noticed something. While my app only uses about 300Mb of memory (stable). The 'other' shows about 1.5 gigabyte of memory used (my guess is ARKit is RAM hungry).

    When I start recording a video, that 'other' memory quickly increases and the app crashes roughly when it hits 2.7Gb (which makes sense as iPhoneX has 3Gb of RAM).

    The weirdest part is, if I set the xcode scheme to debug build (not 'ReleaseForRunning') the memory remains stable and the app doesn't crash with 5 minute of video recorded. I think there might be some memory leak with the video recording that shows up as 'other' resouce memory in xcode. Maybe its AVFoundation but I'm not quite sure what you use under the hood in iOS.

    Any assistance would be greatly appreciated.
     
  21. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    What is your recording resolution? This usually happens when recording at resolutions bigger than 1920x1080. It's also interesting that you've observed that this only happens when the app is running in release mode. I'm not too sure why this is the case. I can confirm for a fact that there is no memory leak at NatCorder's levels of operations, and I highly doubt that AVFoundation has a memory leak either (millions of apps would be broken if this was the case).
     
  22. renboxue

    renboxue

    Joined:
    Jul 12, 2014
    Posts:
    6
    I use only NatCorder,you can see it in the screenshot of the example project.And I had bought the NatCam,latest version too,when I import both of them to the project,there has a conflict,so I removed the NatCam.

    But it is not important,I had gave up to use the latest NatCorder,I want use the old version,it is more stable and ease to use,so please tell me,how can I let the SaveCallBack called in the old version,repeat again,the old version.Or other method to get the recorded file's path in the old version.
     
  23. niv_onehamsa

    niv_onehamsa

    Joined:
    Oct 30, 2016
    Posts:
    13
    I'm out of office today but will try 1080p - I think i'm recording at 75% of native screen (which should be lower than 1080p). But maybe the unusual resolution triggered it.

    I agree about AVFoundation being pretty popular but still this is very strange behavior ...
     
    Lanre likes this.
  24. Raisanen

    Raisanen

    Joined:
    Jan 18, 2017
    Posts:
    3
    I have also the same issue. I tried to update to the latest Unity version, but the issue still exists. Also those linked threads pointed to very old Unity version. How should we proceed?

    Here is the error message:
    -[MTLRenderPipelineDescriptorInternal validateWithDevice:], line 2400: error 'No valid pixelFormats set.'
    -[MTLRenderPipelineDescriptorInternal validateWithDevice:]:2400: failed assertion `No valid pixelFormats set.'
     
  25. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Which version of NatCorder are you referring to? NatCorder has never had a SaveCallback (it's called VideoCallback). So I'm still confused because you seem to be mixing up NatCorder and NatCam.

    We don't provide support for older versions of our API's (because we tend to have fixed issues that people are facing with them). Also looking through the NatCam changelogs, there is no mention of this bug so I'm not sure what's going on here. There isn't any way to get the video path other than the SaveCallback.

    NatCorder should be working. What device and OS version are you running on? Can you try other devices, or upgrading your device's OS version?
     
  26. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Try this:
    - Open Xcode and under 'Product' in the top control bar, go to Scheme > Edit Scheme
    - In the Options tab, disable Metal API Validation
    - Test it out.
     
  27. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    NatCorder 1.3 will be out soon!

    So check out the article linked on the exciting new features we've added. Unity should approve the package in a few days.
     
  28. renboxue

    renboxue

    Joined:
    Jul 12, 2014
    Posts:
    6
    Sorry,why did you say had never a SaveCallback?It is in your 1.6 version of NatCam,I know you divide it into two plugins,but the record functions are same.
    My Ios device is ipad MD513CH/A,ios 8.4.1(12H321),and my unity version is 2017.2.0f3.And as my test result,I believe there are the same issue in several android devices.
     

    Attached Files:

  29. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Yes, you had them mixed up. NatCorder never had a SaveCallback, NatCam did. I need to be clear on which API you are referring to, so that I can investigate what is going on.
    This is probably not the exact same issue. Our API's use completely separate implementations for each supported platform, so usually an issue is only affecting one platform or another--not multiple. If you are facing this issue on Android with NatCorder, then share the full logs from logcat. The logs almost always mention what exactly is going on.

    As for the iPad, I think the issue is device-specific because I am completely unable to reproduce it on my test devices (iPhone 5 SE, iPhone 7+, iPhone X all running OpenGL ES2 as opposed to Metal). As for the SaveCallback with NatCam, can you share the logs from Xcode?
     
  30. lockead

    lockead

    Joined:
    May 13, 2014
    Posts:
    1
    Can it recodeing to a mp4 file on windows10 ?
     
  31. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    You can make functions that are called by the UI system. Look up tutorials on Unity's UI events system.
    The flag controls which camera is picked. It does not support switching.
     
  32. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Yes, NatCorder can record MP4's on Windows.
     
  33. dalpek

    dalpek

    Joined:
    Aug 20, 2014
    Posts:
    8
    Hi,
    Congratulations on a great and easy to use plugin!
    I integrated NatCorder and NatShare into my Vuforia application last week and it was working perfectly on android and iOS.
    I just updated to the new v1.3f1 and I'm getting choppy audio on android and iOS when the screen is recorded (i'm using microphone audio). The video is OK. I'm testing on a Samsung S8+ with Unity 2018.1.2f1
    Any ideas?
     
  34. yCatDev

    yCatDev

    Joined:
    Jun 17, 2017
    Posts:
    23
    Hi, Lanre. We using your NatCorder to record video from out Vuforia application. In Android and Editor everything working fine, but on IOS video not saving...
    Code (CSharp):
    1. public void StartRecording () {
    2.  
    3.         if (!Microphone.IsRecording (Microphone.devices[0]))
    4.             Camera.main.gameObject.GetComponent<AudioSource> ().clip = Microphone.Start (Microphone.devices[0], false, 60, 44100);
    5.         if (!Camera.main.gameObject.GetComponent<AudioSource> ().isPlaying)
    6.             Camera.main.gameObject.GetComponent<AudioSource> ().Play ();
    7.         Replay.StartRecording (
    8.             Camera.main,
    9.             new Configuration (Configuration.Screen.height, Configuration.Screen.width, 24, 716800, 40),
    10.             OnVideo,
    11.             Camera.main.gameObject.GetComponent<AudioSource> (),
    12.             true);
    13.     }
    Code (CSharp):
    1. void OnVideo (string path) {
    2.         Debug.Log ("Saved recording to: " + path);
    3. #if UNITY_IOS
    4.         NatShare.Share ("file://" + path);
    5. #elif UNITY_ANDROID
    6.         NatShare.Share (path);
    7. #endif
    8.     }
    Where is my issue?
    P.S. Sorry for my English)
     

    Attached Files:

  35. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Thank you! Are you recording only the microphone, or are you also recording with game audio? I'm looking into this.
     
  36. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Your code mostly looks good, but your keyframe interval is very big (40 seconds is very large). Can you share the logs from Xcode?
     
  37. yCatDev

    yCatDev

    Joined:
    Jun 17, 2017
    Posts:
    23
    I am cant show you logs, becouse cant to take it... When I dont change bitrate and keyframe interval I get same result...
    Thank you for replay, I am try to get logs...
     
  38. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    I need the logs to get a sense of what's really going on; without it, I can't be of much help.
     
  39. yCatDev

    yCatDev

    Joined:
    Jun 17, 2017
    Posts:
    23
    After updating NatCorder Unity get errors in all scripts what using "Configuration" or "VideoCallback":
    Assets/NatCorder/Plugins/Managed/Replay/Replay.cs(39,68): error CS0246: The type or namespace name `Configuration' could not be found. Are you missing an assembly reference?
    Assets/NatCorder/Plugins/Managed/Replay/Replay.cs(39,97): error CS0246: The type or namespace name `VideoCallback' could not be found. Are you missing an assembly reference?
    In VS Code no errors. I am try Reimport but nothing changed
     
  40. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Delete NatCorder from your project and reimport it from the Asset Store. Check the changelog for information on what we changed.
     
  41. yCatDev

    yCatDev

    Joined:
    Jun 17, 2017
    Posts:
    23
    Thank you! You do too many changes, I am hope that it can to resolve our last bug with saving video.
     
    Lanre likes this.
  42. ferCordoba

    ferCordoba

    Joined:
    Jun 9, 2017
    Posts:
    2
    Hi! I've just set up NatCorder in mi app to record video and GIF. Video works fine, but the gif quality is not the best. Is there a way to improve the GIF quality?
     
  43. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    What platform are you recording GIF's on? If it's Android, we are already working on a way to improve color quantization.
     
  44. ferCordoba

    ferCordoba

    Joined:
    Jun 9, 2017
    Posts:
    2
    Yes, it is Android! Looking forward to the updates with improved GIF color. Thanks!
     
  45. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    We are too. We've gotten a few requests to add support for transparent GIF's so we're planning to do all that in one update.
     
  46. yCatDev

    yCatDev

    Joined:
    Jun 17, 2017
    Posts:
    23
    Hi again. We fixed our bug. It was in OnVideo. I am just removed "file://" from NatShare.Share
    Code (CSharp):
    1. void OnVideo (string path) {
    2.         Debug.Log ("Saved recording to: " + path);
    3. #if UNITY_IOS
    4.         NatShare.Share (path);
    5. #elif UNITY_ANDROID
    6.         NatShare.Share (path);
    7. #endif
    8.     }
     
    Lanre likes this.
  47. yCatDev

    yCatDev

    Joined:
    Jun 17, 2017
    Posts:
    23
    But we have another problem. When user first time press record button IOS request permission for microphone. After agree app record 1-2 seconds and trying to share it...
     
  48. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    You can avoid this by requesting the microphone permission before they start recording. Check the RequestUserAuthorization function provided by Unity.
     
  49. Phoera

    Phoera

    Joined:
    Mar 10, 2015
    Posts:
    9
    @Lanre hi, I'm trying to use NatCorder&NatShare in my ArCore/ArKit project, but by so far I've gotten to situation where I'm getting black screen instead of AR camera view
    I've seen you said you could provide libs which don't use multithreading, I suspect this might be the issue. Could you please send me libs for app with disabled multithreading?
    ps. this happens on samsung A7, but on S8 everything is ok =\
     
    Last edited: Aug 7, 2018
  50. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,973
    Can you email me the full logs from logcat? I've heard of an issue where suspending the app causes the camera preview to go black, but this is a Unity issue (not NatCorder).