48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using UnityEngine;
|
|
//using NatCorderU.Core;
|
|
|
|
public class Recorder : MonoBehaviour
|
|
{
|
|
public Camera mainCamera; // 主相机
|
|
public RenderTexture uiRenderTexture; // UI层的RenderTexture
|
|
|
|
//private MP4Recorder recorder; // 录制器
|
|
//private CameraInput cameraInput; // 相机画面输入
|
|
//private TextureInput uiTextureInput; // UI层纹理输入
|
|
|
|
//private void Start()
|
|
//{
|
|
// // 创建录制器
|
|
// recorder = new MP4Recorder(Screen.width, Screen.height, 60);
|
|
|
|
// // 创建相机画面输入
|
|
// cameraInput = new CameraInput(recorder, mainCamera);
|
|
|
|
// // 创建UI层纹理输入
|
|
// uiTextureInput = new TextureInput(recorder, uiRenderTexture);
|
|
//}
|
|
|
|
//private async void Update()
|
|
//{
|
|
// // 录制帧
|
|
// await recorder.CommitFrame();
|
|
//}
|
|
|
|
//public async void StartRecording()
|
|
//{
|
|
// // 开始录制
|
|
// await recorder.StartRecording();
|
|
//}
|
|
|
|
//public async void StopRecording()
|
|
//{
|
|
// // 停止录制
|
|
// await recorder.StopRecording();
|
|
|
|
// // 释放资源
|
|
// cameraInput.Dispose();
|
|
// uiTextureInput.Dispose();
|
|
// recorder.Dispose();
|
|
//}
|
|
}
|