Replay

Replay operator properties for Script Engine. Records the most recent video frames into a rolling in-memory buffer and plays them back on demand. Useful for instant replays of a moment that just happened — sports highlights, an action that needs a second look, or any "rewind the last few seconds" workflow. Recording and playback are controlled via commands; playback can run at the original speed or in slow motion. After playback the operator can either pass the live image through or output a black frame.

Property Type Access Description
AutostartRecording bool get/set When true, the operator starts recording automatically when the project loads. [default=false]. Useful when you always want a fresh rolling buffer of the last few seconds available — no need to manually press Record at the start of each show.
StartRecordingAfterPlayback bool get/set When true, recording resumes automatically as soon as a replay finishes playing back. [default=false]. Keeps the rolling buffer fresh between replays. Disable if you want to manually control when each new recording starts.
JpegQuality int get/set JPEG quality used when storing each frame, 10–100. [default=80]. Higher values give better-looking replays but use more memory per frame, so MaxFramesInMemory worth of buffer takes longer to fill memory at low quality than at high quality. 80 is a good balance for HD; raise to 90+ for very clean freeze-frames at the cost of memory.
DefaultOutput ReplayOperatorDefaultOutput get/set What the operator outputs when it is neither recording nor playing back. [default=PassThrough]. Pass-through lets the live image through unchanged — the operator is invisible when idle. None outputs a black frame instead — useful when the replay layer should hide the live picture between replays.
MaxFramesInMemory int get/set Maximum number of frames kept in the rolling buffer. [min=1, max=300, default=100]. Once the buffer is full, the oldest frame drops out as a new one comes in. At 50 fps a buffer of 300 frames covers about 6 seconds of replay. Higher values give longer replays at the cost of memory.
PlaybackSpeed ReplayOperatorPlaybackSpeed get/set Replay playback speed. [default=Every (100%)]. 100% plays back at real time. Lower values play back in slow motion (50%, 33%, 25% and so on, down to a frozen 0%). Useful for sport replays where slowing the action makes the moment readable.
PlaybackStartFrame int get/set First frame in the buffer to play back. 1 is the oldest frame still in the buffer. Combined with PlaybackStopFrame this lets you replay only a chosen segment of the recording instead of everything.
PlaybackStopFrame int get/set Last frame in the buffer to play back. Playback stops once this frame is reached. Set this lower than the buffer size to replay only the lead-up to a moment, rather than everything that's been recorded.
PlaybackCurrentFrame int get Frame currently being played back (read-only). Updates as playback progresses through the buffer. Useful from a script for reacting to specific moments during replay.
PlaybackStartFrameTimeString String get Wall-clock time of the frame that will play first when playback starts (read-only). Formatted as HH:mm:ss.fff. Helps confirm which moment the start of the replay corresponds to in the original recording.
PlaybackCurrentFrameTimeFromBufferStart TimeSpan get How long ago the currently played-back frame was recorded, relative to the start of the buffer (read-only). Useful for showing an "elapsed time within the replay" readout.
PlaybackCurrentFrameTime DateTime get Wall-clock time at which the frame currently being played back was originally recorded (read-only).
PlaybackState ReplayOperatorState get Current operator state (read-only). Stopped — idle. Recording — capturing the live signal into the rolling buffer. Playback — replaying buffered frames. Useful from a script for reacting to state changes (e.g. log when a replay finishes).
CommandStartRecording Command get Start a fresh recording — clears the buffer and begins capturing live frames.
CommandStartPlayback Command get Begin playing back the recorded frames between PlaybackStartFrame and PlaybackStopFrame at the chosen PlaybackSpeed.
CommandStop Command get Stop the current activity — whether the operator is recording or playing back, this returns it to the idle state.
ResetCmd Command get Reset all settings to their defaults (80% quality, 100-frame buffer, full-range playback, stopped).
NumberOfFramesInStorage int get Number of frames currently held in the rolling buffer (read-only). Grows up to MaxFramesInMemory and then stays there as old frames are dropped.
FrameBufferFull bool get True once the buffer has filled up to MaxFramesInMemory (read-only). Useful for waiting until enough material has been captured before allowing playback.
FrameStoreDurationString String get Time span covered by the current contents of the buffer, formatted as seconds.fff (read-only).
FrameStoreStartTime DateTime get Wall-clock time at which the oldest frame in the buffer was recorded (read-only).
FrameStoreStopTime DateTime get Wall-clock time at which the newest frame in the buffer was recorded (read-only).
FramesMemoryUsage int get Approximate memory used by the buffered frames, in megabytes (read-only). Drops as JpegQuality is lowered or as MaxFramesInMemory is reduced. Watch this when running long replay buffers on memory-constrained machines.

Inherits from: AbstractOperator, AbstractAudioMetering.

See also: Replay in Operators — user-facing introduction, screenshots, and section summaries.