Video
This function block plays a video file and outputs individual frames for processing. It lets you choose a file, control playback mode, and provides a timestamp and loop/restart information alongside each frame.
π₯ Inputs
Restart This input socket accepts a boolean that, when true, restarts the video playback from the beginning. (Input socket)
π€ Outputs
Image Any Frame image read from the video. (Output socket)
Timestamp Human-readable timestamp for the current frame within the video. (Output socket)
Restarted Boolean flag that becomes true when the video reaches the end and restarts. (Output socket)
πΉοΈ Controls
Select video file Button to choose the video file to play. (Control)
Real-time Switch to enable or disable real-time playback. When enabled, frames are advanced to match the original video frame rate. (Control)
π¨ Features
Smooth playback with optional real-time synchronization so frames follow the original video timing.
Frame-level output with a convenient timestamp string for each frame.
Looping behavior and a restart control to reset playback from the start.
Ability to preview or forward frames to downstream processing blocks (for example detections, logging or saving).
Optional background frame handling for integrations that upload or log frames externally.
βοΈ Running mechanism
When a video file is selected, the block opens it and prepares playback.
If the
Real-timeswitch is on, the block advances frames so the playback rate matches the source video's frames per second. If off, frames advance as fast as the system evaluates the graph.Sending a true signal to the
Restartinput will reset playback to the first frame.Each evaluation outputs the latest frame, a readable timestamp indicating the frame position inside the video, and a boolean indicating if the video looped or restarted.
π Usage instructions
Click the
Select video filebutton and choose a supported video file.Turn
Real-timeon if you want playback to match original speed; turn it off to step frames as fast as processing allows.Optionally send a true value to the
Restartinput to reset playback.Connect the
Image Anyoutput to visualization or analysis blocks to process each frame.
π‘ Tips and Tricks
Preview frames while developing: connect
Image AnytoShow Imageto quickly inspect frames.Save important frames or recordings: route
Image AnytoImage LoggerorRecord Videoto store frames or make a video file.Reduce processing load: add an
Image ResizerorImage Resizeblock before heavy analysis blocks (for exampleObject DetectionorPose Estimation) to lower resolution and increase throughput.Improve detection quality: to denoise them with
Denoisingbefore object/pose models.Background subtraction workflows: combine with
Background Subtractorto detect moving objects before sending results toObject DetectionorBlob Detector.Region-limited processing: use
Image ROI SelectorImage ROIto crop to areas of interest and then runFind Object,Mask Detectionor OCR blocks for focused analysis.Tracking and analytics: pair
Object Detection(orObject Detection - Custom) withObject_Detection_Trackerto track detections across frames and feed the tracker output to analysis blocks likeTraffic Intersection Analysis.Text extraction: use
OCRorOCR (EasyOCR)on frames (optionally after cropping withImage ROI Select) to read printed labels or timestamps.
(hint) When working with long videos, consider turning off Real-time during configuration and testing to iterate faster; switch it on for timed playback during final runs.
π οΈ Troubleshooting
No frames appear: ensure a valid video file was selected with
Select video fileand that the file is accessible.Playback too slow: if
Real-timeis enabled but system cannot keep up, try disablingReal-timeor reduce the frame size withImage Resizer.Video restarts unexpectedly: the end-of-file triggers a restart flag on output; use the
Restartinput to explicitly control playback position.Timestamps seem off: timestamps are calculated relative to the video duration; verify the chosen file's metadata and try a different file if values appear incorrect.
If you plan to stream frames into cloud or logging services, combine the block with Image Logger, Record Video, or other export blocks to persist results.
Last updated
Was this helpful?