Class UiVideoRecorder
java.lang.Object
com.render.testkit.UiVideoRecorder
- All Implemented Interfaces:
AutoCloseable
Bounded real-frame recorder for dedicated development clients. Call
capture(RenderTarget, double) after rendering, and wait until
busy() is false before advancing a deterministic scenario's clock or input. PNG frames remain available even
when the explicitly installed FFmpeg encoder fails.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA persisted frame's real capture timestamp and deterministic scenario animation time.static final recordFinal report; success requires verified MP4 dimensions, cadence, count, duration, and a written manifest. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbusy()True until the outstanding GPU readback and PNG write both complete.booleancapture(com.mojang.blaze3d.pipeline.RenderTarget target, double animationTime) Requests the current rendered frame.voidclose()Stops asynchronously.booleanTrue while new frames may be admitted.static UiVideoRecorderStarts a recording in a newly created, sanitized label subdirectory.stop()Stops admitting frames and returns the same asynchronous completion on every call.
-
Method Details
-
start
public static UiVideoRecorder start(Path directory, String label, int fps, int maxFrames, String ffmpegExecutable) throws IOException Starts a recording in a newly created, sanitized label subdirectory. Existing recordings are never overwritten. FPS is 1..120 and the frame limit is 1..1800. Encoding uses the supplied executable directly; no tool is downloaded.- Throws:
IOException- when the output cannot be created, including a filename collision
-
capture
public boolean capture(com.mojang.blaze3d.pipeline.RenderTarget target, double animationTime) Requests the current rendered frame. Returns false while a previous readback/write is pending or the recorder has stopped; callers must not advance their scenario when admission is refused. Invoke on the render thread. -
busy
public boolean busy()True until the outstanding GPU readback and PNG write both complete. -
isRecording
public boolean isRecording()True while new frames may be admitted. A limit, readback, or write failure automatically stops admission. -
stop
Stops admitting frames and returns the same asynchronous completion on every call. An outstanding frame is drained before encoding; the render thread never waits for disk IO or the encoder process. -
close
public void close()Stops asynchronously. Observestop()to ensure the manifest/video has been finalized before client exit.- Specified by:
closein interfaceAutoCloseable
-