Stream Reader

This function block plays network streams (YouTube, Twitch, HTTP/RTSP and similar) in the background and keeps the latest frame ready for other blocks to consume. It is designed for continuous stream previewing and downstream processing with controls for playback rate, requested quality and frame rate limiting.

πŸ“₯ Inputs

This function block does not have any inputs.

πŸ“€ Outputs

Image Any The latest frame retrieved from the provided streaming source (keeps updating as the stream plays).

πŸ•ΉοΈ Controls

Status Displays current state and helpful messages (e.g., waiting, connecting, live, paused, reconnecting).

Stream URL Enter the stream address or link you want to play (examples: public live links, HTTP livestreams, or provider links).

Playback speed Adjust playback rate (range shown in the UI). Use values below 1.0 for slow motion or above 1.0 for faster playback.

Preferred quality Request a preferred stream quality when multiple renditions are available (e.g., Best, 1080p, 720p).

FPS limit Limit the outgoing frame rate produced by this block. Set to 0 to use the source's native frame rate.

Pause playback Toggle to pause/resume the stream without closing the connection.

🎨 Features

  • Background streaming: plays remote streams on a background process so the UI remains responsive while keeping the latest frame available.

  • Robust connection handling: shows clear status messages (connecting, live, paused, reconnecting) and attempts to recover from transient errors.

  • Playback control: control playback speed and request a specific rendition when available.

  • Frame rate limiting: reduce downstream load by capping frames per second.

  • Optional remote frame upload: when configured, captured frames can be sent to a remote uploader for storage or logging.

  • Pause without losing last frame: pausing keeps the last frame available for inspection or processing.

πŸ“ Usage Instructions

  1. Enter a streaming link into Stream URL.

  2. Adjust Preferred quality if you want a specific rendition.

  3. Set desired Playback speed and FPS limit to control how the stream is delivered to downstream blocks.

  4. Use Pause playback to temporarily halt frame updates while keeping the connection.

  5. Connect this block's output Image Any to visualization or processing blocks to consume live frames.

πŸ“Š Evaluation

When active, this function block continuously fetches frames from the configured stream and provides the most recent frame through the Image Any output. Status messages update to reflect connection state. If paused, frame updates stop but the last frame remains available.

πŸ’‘ Tips and Tricks

  • To preview the live stream interactively, connect the Image Any output to the Show Image block so you can open the image viewer and inspect frames.

  • Reduce CPU/GPU load by connecting Image Any to an Image Resizer block before heavy AI blocks like Object Detection (D-FINE), Mask Detection, Pose Estimation.

  • For long-term recording or debugging, pipe the output to Record Video, Image Logger or Image Write.

  • Use Background Subtractor on the stream output to detect motion or extract foreground regions for downstream detectors (e.g., Object Detection - Custom).

  • If you need to focus on a specific area of the scene, use Image ROI, Image ROI Select or Image ROI Polygon before detection or measurement blocks (like Find Object or Histogram On Line).

  • Combine with Object_Detection_Tracker and Draw Detections to track and visualize detected objects across frames from the stream.

  • For OCR on live streams, connect the output to OCR or OCR (EasyOCR) after applying suitable cropping (Image ROI Select) and image enhancement (Contrast Optimization or Denoising).

  • If the stream source is large or unstable, try lowering FPS limit or reducing Preferred quality to improve stability and reduce bandwidth.

πŸ› οΈ Troubleshooting

  • If the status shows "Waiting for stream link", ensure Stream URL is a full URL including the scheme (e.g., http://, https://, rtsp://).

  • If connection fails or frequently reconnects, try lowering requested quality or reducing the FPS limit to ease bandwidth and processing.

  • If frames stop updating while status shows live, toggle Pause playback off and on to force a refresh.

  • If you need to debug connection messages, monitor the block's Status label for textual hints about connection progress or errors.

Last updated

Was this helpful?