News: Issue with Unity IL2CPP Support

A few people have reported a nasty crash issue when running their iVidCapPro-enabled project with the IL2CPP support in Unity 4.6.2.  I have been successful in recreating this problem.  I was uncertain at first if I would be able to do so, since I don’t have a 64-bit device to run on.  It appears, however, that the issue is wholly related to the IL2CPP backend vs. the Mono backend and “64-bitness” is not the issue.

I’ve investigated the problem following the detailed info kindly provided by user Al (Thanks Al!).  I can see that the AVAsset mixedAudioAsset is not being properly loaded with the audio track, but I can see no reason why this should be the case.

Since the code works fine when the Unity Mono backend is used, I have submitted a bug to Unity.  The case id is: 670853

Here’s a link to the Unity tracker page: 670853 Tracker Link

The problem appears solely related to audio. As a workaround, if you disable audio recording (change your call to BeginRecordingSession to specify No_Audio) you should be able to continue making video recordings.

I’ll make another post here when I have more information.



11 thoughts on “News: Issue with Unity IL2CPP Support

  1. Hi Carlos,

    Thanks for the info! I am also finding that it appears to have fixed the IL2CPP problem.

    4.6.2p2 does appear to have introduced a compatibility problem with the iVidCapPro GL context fetching function in I’ve got a fix for this under development.


    • Hi James,

      Yes, i found that problem too, i’ve managed to fix it replacing the code of the “extern “C” EAGLContext* ivcp_UnityGetContext(){}” function with a call to this function:

      return UnityGetMainScreenContextGLES();

      And it worked.


  2. Pingback: Announcement: iVidCapPro 1.6 Available | eOe

  3. Hi Carlos –

    I’m running into a different error (have the patch & latest iVidCapPro)

    calling from unity:
    vidcap.BeginRecordingSession(“MyVid”,960, 640,30,iVidCapPro.CaptureAudio.No_Audio,iVidCapPro.CaptureFramerateLock.Unlocked);
    i’ll get this crash error on pressing record:

    line 46:
    – (UnityDisplaySurfaceGLES*)surfaceGLES { assert(_surface->api != apiMetal); return (UnityDisplaySurfaceGLES*)_surface; }

    Assertion failed: (_surface->api != apiMetal), function -[DisplayConnection surfaceGLES]

    if I call using say 100×100 as the frame size, I’ll get a non-crash warning of unsupported frame size on starting record:
    iVidCapPro-BeginRecordingSession called with an unsupported frame size: 100×100

    and no frames will be recorded.

  4. Hi Alex,

    Few questions for you:

    – What model of device are you running?
    – In the Unity editor, Player Settings, what is the setting of Graphics API?

    Regarding the 100×100 frame size error message – 128×128 is the smallest frame size that is supported. This is due to limitations in the underlying iOS video framework.


  5. I have a weird problem on iPhone 5S built for OpenGL3. My camera is targeted onto a WebCamTexture that’s set for a quad with with Mobile/Unlit shader on it. A really simple setup.

    If I completely detach iVidCapPro from the project, I can see the back camera video on the screen. All as intended.

    If I attach the iVidCapProVideo and iVidCapProAudio onto the camera that also has an AudioListener and inject the two into a separate iVidCapPro — I can record the video and it’s being successfully saved into a file in Camera Roll. However, neither before, nor during and nor after the recording can I see anything on the screen anymore. It’s completely dark.

    Now if I keep the whole iVidCapPro setup in the scene but never call BeginRecordingSession( ) I still experience the black screen.

    It seems as if iVidCapPro successfully captures the video from the camera but doesn’t let it further through.

    Any ideas how I’d fix this? Been playing around with build settings for the whole day to no avail:(

    Thank you very much in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *