This sample project is built with Unity Engine and supports the Android platform only. It demonstrates how to capture frames from Unity’s Main Camera and save them as an .mp4 video file on an Android device.
-
Capture Unity Main Camera frames
-
Record and save video in .mp4 format
-
Unity C# implementation for frame capture
-
Native Android .aar plugin for video encoding and saving
- Unity Editor 6000.3.8f1 ( might work with other Unity Versions)
- Android OS 8.0 and up
If you are looking for Passthrough camera frame recording on Meta Quest 3, please refer to the Meta Quest Passthrough Recorder sample project.
Go to Scenes folder. ScreenRecordSample scene has sample code and basic setup.
javaClass.Call<string>("InitRecording", Width, Height, fps, filePath, isRGBA);
javaClass.Call("AddVideoFrames", sdata);
javaClass.Call("StopRecordVideo");
- GitHub - duzexu/Record_Screen_In_Unity : This repository provides the code to record screen in unity by making Unity project as Android Library.
- RGB2YUV : This code supports conversion of RGB frames to YUV.
- NV21Utils : This code supports conversion from NV21 to other different formats.