Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[released] Next Gen Recorder - Free Version Now Available!

Discussion in 'Assets and Asset Store' started by pmjo, Apr 10, 2019.

  1. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Hi,

    I am happy to announce that I have just released a free version of Next Gen Recorder. The free version is identical with the paid version except it is missing the customizable watermark feature and a small watermark is always rendered on top of the video.

    Free: https://assetstore.unity.com/packages/tools/video/pmjo-s-next-gen-recorder-free-beta-143045
    Paid: https://assetstore.unity.com/packages/tools/video/pmjo-s-next-gen-recorder-beta-140787

    Next Gen Recorder is a video recording library that takes the gameplay recording to the next level. Currently it is available for iOS, tvOS and macOS platforms when using Metal or OpenGL renderer.

    Features
    • high performance, 60 fps recording
    • record any 2d texture, not just the screen
    • highlight recording, export the whole gameplay or just the most important parts
    • custom watermark, not in Free version
    • easily save the video to the photos or share it through the native share sheet
    • session support, record multiple gameplay videos and choose later what video to share
    • full access to the recorded video so you may also implement your own sharing/upload code when needed
    • custom bit rate, frame rate and video size support
    • also works in Unity editor on macOS
    Beta

    Currently Next Gen Recorder is released as a beta. All testing is <3 HIGHLY APPRECIATED <3 and bugs/issues can be reported to support@pmjo.org. Beta does not mean that you cannot release your game with it. It is just because I personally haven't had enough time for testing and courage to go 1.0. So if you find it working enough, go ahead and use it in production!

    With love for Everyplay fans,
    - pmjo

    ps. more info at http://www.pmjo.org/nextgenrecorder





     
    Last edited: Apr 10, 2019
  2. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    If you have any feature requests, feel free to type them here :)
     
  3. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    I just found a regression with 0.9.7.2 that can cause issues with multi camera/scene setups and also when using command buffers. For example the Unity Adventure sample game recording will not work correctly even you follow the tutorial. I will be releasing a new update with fix shortly. Meanwhile, please use 0.9.7.1.

    To work around the issue with command buffers, please check IsReadyForRecording == true before creating the command buffer.
     
  4. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Fix is now available on the Asset Store, version: 0.9.7.3.
     
  5. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Hi!
    Is there any chance Next Gen Recorder will be available for Android anytime soon?
    Thanks
     
  6. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    I don't want to make any promises about possible Android version. I have very limited time and I would still want to make the iOS version better before focusing on Android.. if it happens, it will take many many months. I am sorry I cannot give you better news :)
     
    adrianuspax and Menion-Leah like this.
  7. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,969
    Developer of NatCorder here. I have a few notes on your comparison with NatCorder. I have bulleted it to make it easier to navigate:
    • Developers who choose to add a watermark to their NatCorder-recorded videos can do so pretty easily, even though it's not out of the box like yours.
    • What you define as recording sessions seems to simply be a sequential set of individual recordings. Again, building a system like this with NatCorder amounts to keeping a list of paths to previously recorded videos.
    • Building on the previous point, NatCorder actually allows recording to several media outputs in parallel. You could record to multiple MP4 and GIF files concurrently if you so decided.
    • NatCorder does support pausing and resuming recording; the only difference is how it is conceptualized with the API. NatCorder has a more fundamental approach to recording, where it is a process of feeding video and audio frames to a recorder instance. To pause recording with NatCorder, the client simply stops committing frames to be recorded over the duration of the pause. So it is not fair to say NatCorder doesn't support pausing; it's not an apples-to-apples comparison.
    • On thumbnails, you are simply just saving a video frame from the session (without allowing the user specify a time to actually get the thumbnail). NatShare, NatCorder's free social sharing extension API, supports getting a thumbnail from a recorded video, and provides the user the ability to specify what time to actually extract said thumbnail. Finally, NatShare actually provides the thumbnail as a Texture2D which is more versatile than a file path on the file system (especially considering the overhead of loading JPEG/PNG data into system memory then decoding it with Texture2D.LoadImage)
    • NatCorder doesn't support OpenGL (ES), but the fact that you support OpenGL might not be considered a selling point. Metal is the standard on macOS and iOS now, and boasts much (much) better performance than OpenGL ES. And with Apple forcing its customers to stay on the most recent devices and OS versions, the vast majority of the market has no reason to actually support OpenGL anymore.
    • Define "Easy to Use"...
    The performance comparison is the one point where NatCorder really stands to make a significant improvement, and we already have this locked down in the upcoming update (we're moving to async GPU readbacks). I hope to see the performance comparison updated once the update is live. I respect that you are making marketing materials for customers, but the comparisons might be misleading given that both API's are quite different. Yours is a screen recorder (so you're likely getting access to Unity's backbuffer in sysmem and piping that to AVFoundation); NatCorder, on the other hand, is a general texture recorder so we manually have to perform a readback. Our approach is more volatile performance-wise, but offers much greater flexibility in what we can record, how we can record, and on what platforms we can record. Cheers.
     
    soorya696 and Menion-Leah like this.
  8. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Thanks for your clarification! I try to be as fair as possible and definitely want to fix if you have some of the features already Built-In. So anytime, you implement something and I haven't noticed it, please ping me and I'll fix the marketing material.

    Yes, I know that most of the things can be achieved with NatCorder too with some work. By Built-In I mean that the feature already exists in my plugin and the developer can just use it, instead of first implementing it.

    Once again, this is a feature that exists in Next Gen Recorder out of the box and in NatCorder you must implement it yourself.

    Thanks, this I need to rephrase or just remove.

    I personally haven't tried NatShare. I'll mark this as available in a separate package.

    Yeah, I actually implemented similar feature to Everyplay but haven't had time to implement it to Next Gen Recorder.

    This definitely is a selling point. Next Gen Recorder can run technically just fine with old devices like iPhone4. You aim for new devices, I aim for all devices.

    Well people loved Everyplay since it was really easy to use. Just import and it works. API is simple to use and does not change in every release. Of course this creates limitations what you can do, for example NatCorder has this fancy thing that you can record multiple videos at the same time with custom time stamps. That is cool but normal user does not need those. You must do quite a lot of code to be able to record something with NatCorder. In Next Gen Recorder you import it and use it and for more complex cases you do manual integration. So we aim for different target audience. NatCorder is too complex for newbies.

    When you get to the same level with other recording solutions, I don't need the benchmark slide at all.

    Thanks, please msg me immediately if something needs fixing.

    Wrong. Everyplay was a screen recorder. Next Gen Recorder can record any texture.

    Cheers,
    pmjo
     
  9. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,969
    Thanks!
    That's fair.
    This seems to be more of a philosophical than objective difference. In any case, I respect that.
    This is fair. NatCorder isn't designed to be drag and drop, because we lose versatility in usage patterns. Notwithstanding this difference, the NatCorder API is still pretty simple. There are only 4 self-explanatory methods that devs need to wrap their heads around to extract the full power of the API.
    Didn't notice this from the docs. Good to know.

    Can you PM me with your email address or email me? I'd like to share the upcoming update so that you can benchmark the performance upgrades.
     
  10. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245


    Updated NatCorder column for thumbnail support (available in NatShare for free) and pause/resume (logic easily implemented by user).
     
    Lanre likes this.
  11. adre

    adre

    Joined:
    Mar 28, 2014
    Posts:
    38
    Hi, is it possible to record from device camera, setting resolution and framerate? I need always an output of 1920x1080 25fps.
     
  12. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Next Gen Recorder does not have webcam support out of the box. You could probably do it with some work by using Unity WebCamTexture but it has pretty poor performance, especially on Android. Lanre has a product called NatCam that might fit your needs but please ask him to be sure.
     
    Lanre likes this.
  13. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    By using Unity web cam the code could be something like this:

    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using pmjo.NextGenRecorder;
    4.  
    5. public class WebCamRecorder : Recorder.VideoRecorderBase {
    6.     private WebCamTexture mWebCamTexture;
    7.     private RenderTexture mRecordingTexture;
    8.  
    9.     void Awake() {
    10.         Recorder.TargetFrameRate = 25;
    11.         Recorder.FrameSkipping = true;
    12.  
    13.         mRecordingTexture = new RenderTexture(1920, 1080, 0, RenderTextureFormat.Default);
    14.         mRecordingTexture.Create();
    15.  
    16.         mWebCamTexture = new WebCamTexture(1920, 1080, 25);
    17.         mWebCamTexture.Play();
    18.  
    19.         StartCoroutine(Record());
    20.     }
    21.  
    22.     void OnEnable() {
    23.         Recorder.RecordingStopped += RecordingStopped;
    24.         Recorder.RecordingExported += RecordingExported;
    25.     }
    26.  
    27.     void OnDisable() {
    28.         Recorder.RecordingStopped -= RecordingStopped;
    29.         Recorder.RecordingExported -= RecordingExported;
    30.     }
    31.  
    32.     private void RecordingStopped(long sessionId) {
    33.         Recorder.ExportRecordingSession(sessionId);
    34.     }
    35.  
    36.     private void RecordingExported(long sessionId, string path, Recorder.ErrorCode errorCode) {
    37.         if(errorCode == Recorder.ErrorCode.NoError) {
    38.             Debug.Log("Succesfully saved video to " + path);
    39.         }
    40.         else {
    41.             Debug.Log("Failed to save video :(");
    42.         }
    43.     }
    44.  
    45.     private IEnumerator Record() {
    46.         yield return new WaitForSeconds(2);
    47.         Recorder.StartRecording();
    48.         yield return new WaitForSeconds(4);
    49.         Recorder.StopRecording();
    50.     }
    51.  
    52.     void OnPostRender() {
    53.         Graphics.Blit(mWebCamTexture, mRecordingTexture);
    54.  
    55.         if (RecordingTexture != mRecordingTexture)
    56.         {
    57.             RecordingTexture = mRecordingTexture;
    58.         }
    59.  
    60.         BlitRecordingTexture();
    61.  
    62.         Graphics.Blit(mWebCamTexture, null as RenderTexture);
    63.     }
    64. }
    65.  
    The above snippet should be dropped on top of a camera. Since Unity web cam might not give you the resolution you ask the above example renders the web cam texture to another texture that is the size you want and then records it. The example does not take aspect ratio into account so that you must fix yourself. You also probably want to change how the web cam is rendered to the screen and have some button for the recording logic instead of just recording 4 seconds :)
     
    Last edited: Apr 27, 2019
  14. adre

    adre

    Joined:
    Mar 28, 2014
    Posts:
    38
    Thank you really, gonna try it out asap.
     
  15. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Next Gen Recorder 0.9.7.4 now available. Fixes black video issue when stencil buffers are used on OpenGL.

    Full Changelog:

    - Fixed black video issue with OpenGL when UI Mask or stencil buffers are used in the project
    - Virtual Screen blit camera is now automatically removed when last Virtual Screen is removed
    - Added SavedToPhotos event to Sharing API that gets triggered when saving of a video has completed (or failed)
    - Added a possibility to define an album name when saving to the photos (instead of just saving to Camera Roll)
     
  16. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    It seems the WebCamTexture is oriented incorrectly on a device. Did a new example project about using NGR with UnityWebCamTexture. It has nice things like different render modes (AspectFit and AspectFill), camera switching and it also automatically rotates the things when orientation is changed (in a shader). I will add this example to the next version of Next Gen Recorder but for now you can download it from here.

    Here are the things that you can currently change:



    Currently it only record the screen resolution video but I will probably add an option to record the actual video feed size instead. Changing orientation DURING recording is not supported, it will just ignore the frames coming in in wrong orientation so the app should be locked to portrait or landscape in production or when recording.

    The actual code looks like this:
    Code (CSharp):
    1. using System.Collections;
    2. using UnityEngine;
    3. using UnityEngine.UI;
    4. using pmjo.NextGenRecorder;
    5. using pmjo.NextGenRecorder.Sharing;
    6.  
    7. public class WebCamRecorder : Recorder.VideoRecorderBase
    8. {
    9.     public enum CameraType
    10.     {
    11.         FrontFacing,
    12.         BackFacing
    13.     }
    14.  
    15.     public enum CameraPlaybackType
    16.     {
    17.         AspectFill,
    18.         AspectFit
    19.     }
    20.  
    21.     public enum RecordingFrameRate
    22.     {
    23.         ApplicationFrameRate,
    24.         CameraFrameRate
    25.     }
    26.  
    27.     public Sprite spriteOn;
    28.     public Sprite spriteOff;
    29.     public Button recordingButton;
    30.     public Button switchCameraButton;
    31.     public Material blitMaterial;
    32.  
    33.     public int preferredCameraWidth = 1920;
    34.     public int preferredCameraHeight = 1080;
    35.     public int preferredCameraFrameRate = 30;
    36.     public CameraType preferredCameraType = CameraType.BackFacing;
    37.  
    38.     public CameraPlaybackType cameraPlaybackType = CameraPlaybackType.AspectFit;
    39.     public RecordingFrameRate recordingFrameRate = RecordingFrameRate.CameraFrameRate;
    40.     public int applicationFrameRate = 30;
    41.  
    42.     private WebCamTexture mWebCamTexture;
    43.     private RenderTexture mRecordingTexture;
    44.     private Image mRecordingButtonImage;
    45.     private Vector4 mBlitSize = new Vector4(1, 1, 0, 0);
    46.     private int mBlitSizeProperty;
    47.     private int mBlitAngleProperty;
    48.     private bool mIsFrontFacing;
    49.  
    50.     void Awake()
    51.     {
    52.         Application.targetFrameRate = applicationFrameRate;
    53.  
    54.         // Try to get preferred camera type
    55.         bool requestFrontFacing = (preferredCameraType == CameraType.FrontFacing);
    56.         string deviceName = TryGetCamera(requestFrontFacing, out mIsFrontFacing);
    57.  
    58.         if (deviceName == null)
    59.         {
    60.             Debug.Log("Failed to get camera");
    61.             return;
    62.         }
    63.  
    64.         mRecordingButtonImage = recordingButton.GetComponent<Image>();
    65.  
    66.         // Get shader property ids
    67.         mBlitSizeProperty = Shader.PropertyToID("_Size");
    68.         mBlitAngleProperty = Shader.PropertyToID("_Angle");
    69.  
    70.         // Enable switch camera button if both front camera and back camera found
    71.         switchCameraButton.interactable = HasCamera(true) && HasCamera(false);
    72.  
    73.         // Enable recording button if recording supported
    74.         recordingButton.interactable = Recorder.IsSupported;
    75.  
    76.         // Create webcam texture
    77.         mWebCamTexture = new WebCamTexture(preferredCameraWidth, preferredCameraHeight, preferredCameraFrameRate);
    78.         mWebCamTexture.deviceName = deviceName;
    79.         mWebCamTexture.Play();
    80.  
    81.         // Set recorder framerate
    82.         Recorder.TargetFrameRate = (recordingFrameRate == RecordingFrameRate.ApplicationFrameRate) ? Application.targetFrameRate : preferredCameraFrameRate;
    83.         Recorder.FrameSkipping = false;
    84.     }
    85.  
    86.     void OnEnable()
    87.     {
    88.         Recorder.RecordingStarted += RecordingStarted;
    89.         Recorder.RecordingStopped += RecordingStopped;
    90.         Recorder.RecordingExported += RecordingExported;
    91.     }
    92.  
    93.     void OnDisable()
    94.     {
    95.         Recorder.RecordingStopped -= RecordingStopped;
    96.         Recorder.RecordingStarted -= RecordingStarted;
    97.         Recorder.RecordingExported -= RecordingExported;
    98.     }
    99.  
    100.     private void RecordingStarted(long sessionId)
    101.     {
    102.         mRecordingButtonImage.sprite = spriteOn;
    103.     }
    104.  
    105.     private void RecordingStopped(long sessionId)
    106.     {
    107.         mRecordingButtonImage.sprite = spriteOff;
    108.  
    109.         Recorder.ExportRecordingSession(sessionId);
    110.     }
    111.  
    112.     private void RecordingExported(long sessionId, string path, Recorder.ErrorCode errorCode)
    113.     {
    114.         if (errorCode == Recorder.ErrorCode.NoError)
    115.         {
    116.             Debug.Log("Saving " + path + " to photos");
    117.             Sharing.SaveToPhotos(path);
    118.         }
    119.         else
    120.         {
    121.             Debug.Log("Failed to save video: " + errorCode.ToString());
    122.         }
    123.     }
    124.  
    125.     void OnPostRender()
    126.     {
    127.         if (WebCamTextureNotInitialized())
    128.         {
    129.             return;
    130.         }
    131.  
    132.         float angle = mWebCamTexture.videoRotationAngle;
    133.  
    134.         // Get source orientation and size
    135.         bool srcIsLandscape = mWebCamTexture.videoRotationAngle == 0 || (mWebCamTexture.videoRotationAngle % 180) == 0;
    136.  
    137.         int srcWidth = srcIsLandscape ? mWebCamTexture.width : mWebCamTexture.height;
    138.         int srcHeight = srcIsLandscape ? mWebCamTexture.height : mWebCamTexture.width;
    139.  
    140.         // Get destination orientation and size
    141.         bool dstIsLandscape = Screen.width > Screen.height;
    142.  
    143.         int dstWidth = Screen.width;
    144.         int dstHeight = Screen.height;
    145.  
    146.         // Create recording texture that will be correctly oriented
    147.         if (mRecordingTexture == null || mRecordingTexture.width != dstWidth || mRecordingTexture.height != dstHeight)
    148.         {
    149.             mRecordingTexture = new RenderTexture(dstWidth, dstHeight, 0, RenderTextureFormat.Default);
    150.             mRecordingTexture.Create();
    151.         }
    152.  
    153.         // Debug.Log("CAMERA ANGLE " + mWebCamTexture.videoRotationAngle + " MIRROR " + mWebCamTexture.videoVerticallyMirrored);
    154.         // Debug.Log("CAMERA WIDTH " + mWebCamTexture.width + " HEIGHT " + mWebCamTexture.height);
    155.  
    156.         // Calculate aspect fit or fill
    157.         CalculateBlitSize(srcWidth, srcHeight, dstWidth, dstHeight, ref mBlitSize);
    158.  
    159.         // Flip camera feed if needed
    160.         if (mWebCamTexture.videoVerticallyMirrored)
    161.         {
    162.             if (srcIsLandscape)
    163.             {
    164.                 mBlitSize.y *= -1;
    165.             }
    166.             else
    167.             {
    168.                 mBlitSize.x *= -1;
    169.             }
    170.         }
    171.  
    172.         // Mirror front facing camera
    173.         if (mIsFrontFacing)
    174.         {
    175.             mBlitSize.x *= -1;
    176.         }
    177.  
    178.         // Set shader parameters
    179.         blitMaterial.SetVector(mBlitSizeProperty, mBlitSize);
    180.         blitMaterial.SetFloat(mBlitAngleProperty, Mathf.Deg2Rad * angle);
    181.  
    182.         // Set recording texture if not yet set
    183.         if (RecordingTexture != mRecordingTexture)
    184.         {
    185.             RecordingTexture = mRecordingTexture;
    186.         }
    187.  
    188.         // Blit webcam texture to the recording texture
    189.         Graphics.Blit(mWebCamTexture, mRecordingTexture, blitMaterial);
    190.  
    191.         if (recordingFrameRate == RecordingFrameRate.ApplicationFrameRate || (mWebCamTexture.isPlaying && mWebCamTexture.didUpdateThisFrame))
    192.         {
    193.             BlitRecordingTexture();
    194.         }
    195.  
    196.         // Render webcam to the screen
    197.         Graphics.Blit(mRecordingTexture, null as RenderTexture);
    198.     }
    199.  
    200.     private void CalculateBlitSize(float srcWidth, float srcHeight, float dstWidth, float dstHeight, ref Vector4 blitSize)
    201.     {
    202.         float screenAspect = dstWidth / dstHeight;
    203.         float textureAspect = srcWidth / srcHeight;
    204.  
    205.         if ((cameraPlaybackType == CameraPlaybackType.AspectFit) ^ (screenAspect > textureAspect))
    206.         {
    207.             blitSize.x = 1.0f;
    208.             blitSize.y = screenAspect * (1.0f / textureAspect);
    209.         }
    210.         else
    211.         {
    212.             blitSize.x = (1.0f / screenAspect) * textureAspect;
    213.             blitSize.y = 1.0f;
    214.         }
    215.     }
    216.  
    217.     public void RecordingButtonClick()
    218.     {
    219.         if (WebCamTextureNotInitialized())
    220.         {
    221.             return;
    222.         }
    223.  
    224.         if (!Recorder.IsRecording)
    225.         {
    226.             Recorder.StartRecording();
    227.         }
    228.         else
    229.         {
    230.             Recorder.StopRecording();
    231.         }
    232.     }
    233.  
    234.     public void SwitchCameraButtonClick()
    235.     {
    236.         mWebCamTexture.Stop();
    237.         mWebCamTexture.deviceName = TryGetCamera(!mIsFrontFacing, out mIsFrontFacing);
    238.         mWebCamTexture.Play();
    239.     }
    240.  
    241.     private bool WebCamTextureNotInitialized()
    242.     {
    243.         return mWebCamTexture == null || mWebCamTexture.width <= 16 || mWebCamTexture.height <= 16;
    244.     }
    245.  
    246.     private bool HasCamera(bool frontFacing)
    247.     {
    248.         WebCamDevice[] devices = WebCamTexture.devices;
    249.  
    250.         for (int i = 0; i < devices.Length; i++)
    251.         {
    252.             if (devices[i].isFrontFacing == frontFacing)
    253.             {
    254.                 return true;
    255.             }
    256.         }
    257.  
    258.         return false;
    259.     }
    260.  
    261.     private string TryGetCamera(bool frontFacing, out bool isFrontFacing)
    262.     {
    263.         WebCamDevice[] devices = WebCamTexture.devices;
    264.  
    265.         // Find preferred camera type
    266.         for (int i = 0; i < devices.Length; i++)
    267.         {
    268.             if (devices[i].isFrontFacing == frontFacing)
    269.             {
    270.                 isFrontFacing = devices[i].isFrontFacing;
    271.                 return devices[i].name;
    272.             }
    273.         }
    274.  
    275.         // If preferred type was not found, return first camera
    276.         if (devices.Length > 0)
    277.         {
    278.             isFrontFacing = devices[0].isFrontFacing;
    279.             return devices[0].name;
    280.         }
    281.  
    282.         // If there is no camera, return null
    283.         isFrontFacing = frontFacing;
    284.         return null;
    285.     }
    286. }
    287.  
    And the shader:
    Code (CSharp):
    1. Shader "Next Gen Recorder/WebCam Blit Shader"
    2. {
    3.     Properties
    4.     {
    5.         _MainTex ("Texture", 2D) = "white" {}
    6.         _Size ("Size", Vector) = (1, 1, 0, 0)
    7.         _Angle ("Angle", float) = 0
    8.     }
    9.     SubShader
    10.     {
    11.         Cull Off ZWrite Off ZTest Always
    12.  
    13.         Pass
    14.         {
    15.             CGPROGRAM
    16.             #pragma vertex vert
    17.             #pragma fragment frag
    18.          
    19.             #include "UnityCG.cginc"
    20.  
    21.             struct appdata
    22.             {
    23.                 float4 vertex : POSITION;
    24.                 float2 uv : TEXCOORD0;
    25.             };
    26.  
    27.             struct v2f
    28.             {
    29.                 float4 vertex : SV_POSITION;
    30.                 float2 uv : TEXCOORD0;
    31.             };
    32.  
    33.             float4 _Size;
    34.             float _Angle;
    35.  
    36.             v2f vert (appdata v)
    37.             {
    38.                 v2f o;
    39.                 float4 vertex = UnityObjectToClipPos(v.vertex);
    40.                 o.vertex = vertex;
    41.                 o.vertex.x = cos(_Angle) * vertex.x -  sin(_Angle) * vertex.y;
    42.                 o.vertex.y = cos(_Angle) * vertex.y + sin(_Angle) * vertex.x;
    43.                 o.vertex.xy = sign(o.vertex.xy) * _Size.xy;
    44.                 o.uv = v.uv;
    45.                 return o;
    46.             }
    47.          
    48.             sampler2D _MainTex;
    49.  
    50.             fixed4 frag (v2f i) : SV_Target
    51.             {
    52.                 return tex2D(_MainTex, i.uv);
    53.             }
    54.             ENDCG
    55.         }
    56.     }
    57. }
    58.  
    Other assets you can find in the package.
     
  17. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    The above example seems to just give black screen on newer Unity versions, I guess OnPostrender+Graphics.Blit is a bit broken but should work fine on device. Will try to find a workaround for newer Unity versions at some point.

    Just remeber to add something to the camera usage description inside player settings or the app will get killed.

     
  18. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Allright. Did a workaround for the WebCamRecorder example to make it work inside newer editors too. Instead of using Graphics.Blit it now uses Raw Image to get the web cam texture on to the screen. The WebCamRecorder script no longer needs to be on top of a camera, it can be on top of any game object.



    Download example v2 from here.
     
  19. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Created a new SimpleRecorder prefab for testing the recording. Just import the package and then drop the SimpleRecoder prefab to your hierarchy root and you can test the recording with a simple UI.



    EDIT: In the above image the prefab is added to the Unity Adventure sample game.
     
    Last edited: Sep 4, 2019
  20. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Next Gen Recorder 0.9.7.5 with new examples now available on the Asset Store :)
     
  21. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Next Gen Recorder 0.9.7.6 released on the Asset Store. Updating is highly recommended since it fixes a possible crash issue on iOS and tvOS when the user has gone to the background during recording and returned and then tried to share the video.
     
    Last edited: May 10, 2019
  22. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Next Gen Recorder 0.9.7.7 released on the Asset Store. Now you can also record without audio if needed.

    Changelog:

    - Added support for changing Virtual Screen properties in runtime (BlitToScreen and BlitToRecorder)
    - Added RecordAudio property to the Recorder to allow disabling audio recording. RecordAudio is automatically set to false if no AudioListeners or custom audio recorders are found.
     
  23. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    FYI: There still seems to be problems when recording while going to background and back, for example RecordingStopped will get called when returning even it should not and the resulting video might not be what expected. Hopefully this gets fixed in the next version. Meanwhile, please ignore this issue.
     
  24. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Next Gen Recorder 0.9.7.8 release on the Asset Store.

    Changelog:

    - Improved audio sync when pause/resume functionality used
    - RecordingStopped event is no longer triggered when entering background (internal stop)
    - RecordingStarted event is no longer triggered when returning from the background (internal start)
    - Fixed audio sync of the exported video when the user has entered background during the recording
    - Always round scaled resolution to nearest divisible of 16 to avoid green lines in the exported video
    - Updated WebCamRecorder example, will now check recording permission before starting
     
  25. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    FYI: Always restart the editor after upgrading the plugin to make sure new native code is loaded. New managed code might not work with the old (already loaded) native code.
     
  26. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Next Gen Recorder 0.9.7.9 released on the Asset Store. Fixes some issues and introduces a better highlight export support.

    Changelog:

    - Added one more parameter to ExportRecordingSessionHighlights function so you can now select what highlights or highlight groups are exported into the highlight video! With this you could for example export all head shots, boss kills, goals etc. to separate videos.
    - Fixed a null pointer exception when Virtual Screen is used on a platform that is not supported
    - Added RealtimeRecording property to the Recorder. By default it is enabled but when it is disabled the frames will get written with a constant delta time depending on the current Recorder TargetFrameRate, e.g. delta time = 1.0 / Recorder.TargetFrameRate.
    - Fixed boolean marshaling from native to managed on macOS. Fixes false positives for IsRecording and for some other properties and functions.
     
  27. mtalbott

    mtalbott

    Joined:
    Dec 21, 2011
    Posts:
    125
    @pmjo, In case you were not aware, Next Gen Recorder does not appear to work with Vuforia. In Unity 2018.4.4 and Vuforia 8.3.3, by simple added your package to a vuforia project (no NGR components or scripts used), the camera background plane rendering breaks. Interestingly, the vuforia engine still initializes and tracking still works, just displaying the camera feed is black.
     
  28. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Hi! Thanks for the info, really good to know since I haven't personally tried it. I will take a look into it.
     
  29. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Interesting. Vuforia recording seems to work fine when forcing to OpenGL rendering but with Metal the background plane is black for some weird reason. Hopefully I have more time to investigate this at some point.
     
  30. mtalbott

    mtalbott

    Joined:
    Dec 21, 2011
    Posts:
    125
    Good luck. Would love to give Next Gen a try on our app platform.
     
  31. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Allright, found and fixed the issue. Will send an update to the Asset Store as soon as possible. Hopefully next week! :)
     
  32. mtalbott

    mtalbott

    Joined:
    Dec 21, 2011
    Posts:
    125
    That's great to hear. looking forward to it.
     
  33. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Next Gen Recorder 0.9.7.10 is now out and it should fix the Vuforia issue that you were facing when using Metal renderer.
     
  34. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Updated feature slides:




    Benchmark results:
     
  35. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Oops. I fixed Vuforia Metal support in last release but that actually broke Metal support for the editor/standalone :( I will create a fix and submit it to the Asset Store as soon as possible. Unfortunately the Asset Store queue is really long at the moment. Meanwhile, please use OpenGL Core on the Editor. I am sorry for the inconvenience.

    EDIT: New version 0.9.7.11 that should fix the issue is now out! Please remember to restart the Unity editor after importing the package, otherwise you will get the same crash since Unity has still the old binary loaded.
     
    Last edited: Sep 4, 2019
  36. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    For the next release I am cooking support for Linear rendering and SRP.
     
  37. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    0.9.8.2 version out with experimental Linear colorspace support. Read more about it from the online documentation.

    Changelog:

    - Experimental Linear colorspace support, not enabled by default. Use ColorSpace property to the change the colorspace.
    - Fix export for videos that are recorded with audio enabled but no audio frames are received
    - Stability fixes
     
  38. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    0.9.8.3 out!
     
  39. Conferno

    Conferno

    Joined:
    Feb 27, 2014
    Posts:
    49
    windows support ???
     
  40. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Unfortunately no. There is no plans to support Windows, totally different apis, tools and so on.
     
  41. jerichojanuary

    jerichojanuary

    Joined:
    Dec 6, 2019
    Posts:
    2
    Great work! Looks really nice and it is free? Windows support is a pity...
     
  42. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Thanks! There is a free version that puts a small watermark to the upper right corner of the video but in the paid version you can remove it or use your own watermark.
     
  43. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245