Yalantis/uCrop · warning

load_video() : No opened video stream found.

Error message

load_video() : No opened video stream found.

What it means

CImgList<T>::load_video() warns that no opened video capture stream is available at all (no filename case). Without a stream the call returns without producing frames, so the list stays empty and callers iterating frames get nothing.

Source

Thrown at ucrop/src/main/jni/CImg.h:67355

      // Release stream if needed.
      if (!step_frame || (index>=0 && positions[index]>first_frame)) {
        if (index>=0) {
          cimg::mutex(9);
          captures[index]->release();
          delete captures[index];
          captures[index] = 0;
          positions[index] = 0;
          filenames[index].assign();
          if (last_used_index==index) last_used_index = -1;
          index = -1;
          cimg::mutex(9,0);
        } else
          if (filename)
            cimg::warn(_cimglist_instance
                       "load_video() : File '%s', no opened video stream associated with filename found.",
                       cimglist_instance,filename);
          else
            cimg::warn(_cimglist_instance
                       "load_video() : No opened video stream found.",
                       cimglist_instance,filename);
        if (!step_frame) return *this;
      }

      // Find empty slot for capturing video stream.
      if (index<0) {
        if (!filename)
          throw CImgArgumentException(_cimglist_instance
                                      "load_video(): No already open video reader found. You must specify a "
                                      "non-(null) filename argument for the first call.",
                                      cimglist_instance);
        else { cimg::mutex(9); cimglist_for(filenames,l) if (!filenames[l]) { index = l; break; } cimg::mutex(9,0); }
        if (index<0)
          throw CImgIOException(_cimglist_instance
                                "load_video(): File '%s', no video reader slots available. "
                                "You have to release some of your previously opened videos.",
                                cimglist_instance,filename);

View on GitHub (pinned to f788b534b4)

Solutions

  1. Ensure a capture stream is opened first (load_video with a valid filename or device index)
  2. Compile with cimg_use_opencv and link OpenCV videoio to enable capture
  3. Check that a camera/device exists (e.g. /dev/video0 on Linux) and is not held by another process
  4. Check the returned list is non-empty before consuming frames

Example fix

// before
frames.load_video(0, 30); // device capture
// after
#ifdef cimg_use_opencv
frames.load_video(0, 30);
if (frames.is_empty()) { /* no frames captured */ }
#else
// video capture unsupported in this build
#endif
Defensive patterns

Strategy: fallback

Validate before calling

#ifdef cimg_use_opencv
  frames.load_video(0, fps);
  if (frames.is_empty()) { /* no capture device */ }
#else
  /* capture unsupported */
#endif

Prevention

When it happens

Trigger: Calling load_video() with a null filename when no capture device/stream has been opened; all previously opened streams have been closed or failed; using video capture on a build without cimg_use_opencv so no stream could ever be established.

Common situations: Camera/webcam capture on systems without a video device or without OpenCV videoio support; forgetting to open a stream before polling frames; build missing cimg_use_opencv.

Understand the failure class

Background: "X is not installed. Please install it with pip install Y": missing optional dependency errors — ImportError/ValueError raised when a library's optional extra was never installed — this error's family across 22 libraries.

Related errors


AI-assisted analysis of Yalantis/uCrop@f788b534b4 (2026-09-08). Data as JSON: /api/errors/38663706bce35da6. Report an issue: GitHub.