using UnityEngine; using FFmpegOut; public class FFmpegCapture : MonoBehaviour { public CameraCapture cameraCapture; public bool useScreenSize = true; void Start() { if (cameraCapture == null) { cameraCapture = Camera.main.gameObject.GetComponent(); } if (useScreenSize) { cameraCapture.height = Screen.height; cameraCapture.width = Screen.width; } cameraCapture.enabled = false; } public void StartCapture() { cameraCapture.enabled = true; } public string StopCapture() { cameraCapture.enabled = false; return cameraCapture.videoPath; } }