Hi,
if you want to know what’s going on with the Recorder window, there is no public API for this.
If you are using a timeline with a playable director and a recorder clip, here is how to get its info (the FPS is set by the timeline, and there is no way of knowing if the playhead is inside the clip):
GameObject go = GameObject.Find("TimelinePlaceholder");
PlayableDirector dir = go.GetComponent<PlayableDirector>();
TimelineAsset timeline = dir.playableAsset as TimelineAsset;
float fps = timeline.editorSettings.fps;
RecorderTrack recorderTrack = timeline.GetRootTrack(0) as RecorderTrack;
var recorderClip = recorderTrack.GetClips().ToList()[0].asset as RecorderClip;
var outputFile = recorderClip.settings.OutputFile;
Debug.Log(string.Format("Timeline '{0}' track '{1}' clip '{2}' recording to file {3}.mp4 @ FPS={4}", timeline.name, recorderTrack.name, recorderClip.name, outputFile, fps));
I think your best bet would be to instantiate the recorder yourself via scripting, so that you have more control over what happens and the timing:
var controllerSettings = ScriptableObject.CreateInstance<RecorderControllerSettings>();
var TestRecorderController = new RecorderController(controllerSettings);
var videoRecorder = ScriptableObject.CreateInstance<MovieRecorderSettings>();
videoRecorder.name = "My Video Recorder";
videoRecorder.Enabled = true;
videoRecorder.VideoBitRateMode = VideoBitrateMode.High;
videoRecorder.ImageInputSettings = new GameViewInputSettings
{
OutputWidth = 640,
OutputHeight = 480
};
videoRecorder.AudioInputSettings.PreserveAudio = true;
//videoRecorder.OutputFile; // Change this to change the output file name (no extension)
controllerSettings.AddRecorderSettings(videoRecorder);
controllerSettings.SetRecordModeToFrameInterval(0, 59); // 2s @ 30 FPS
controllerSettings.FrameRate = 30;
RecorderOptions.VerboseMode = false;
TestRecorderController.PrepareRecording();
TestRecorderController.StartRecording();
// Wait a while
If you start the recorder this way, make sure you wait a few frames after the expected end of the recording in case there are GPU readbacks pending.
I hope this answers your question.
Best regards,
Bruno