{"record":{"id":"38663706bce35da6","repo":"Yalantis/uCrop","slug":"load-video-no-opened-video-stream-found","errorCode":null,"errorMessage":"load_video() : No opened video stream found.","messagePattern":"load_video\\(\\) : No opened video stream found\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"ucrop/src/main/jni/CImg.h","lineNumber":67355,"sourceCode":"      // Release stream if needed.\n      if (!step_frame || (index>=0 && positions[index]>first_frame)) {\n        if (index>=0) {\n          cimg::mutex(9);\n          captures[index]->release();\n          delete captures[index];\n          captures[index] = 0;\n          positions[index] = 0;\n          filenames[index].assign();\n          if (last_used_index==index) last_used_index = -1;\n          index = -1;\n          cimg::mutex(9,0);\n        } else\n          if (filename)\n            cimg::warn(_cimglist_instance\n                       \"load_video() : File '%s', no opened video stream associated with filename found.\",\n                       cimglist_instance,filename);\n          else\n            cimg::warn(_cimglist_instance\n                       \"load_video() : No opened video stream found.\",\n                       cimglist_instance,filename);\n        if (!step_frame) return *this;\n      }\n\n      // Find empty slot for capturing video stream.\n      if (index<0) {\n        if (!filename)\n          throw CImgArgumentException(_cimglist_instance\n                                      \"load_video(): No already open video reader found. You must specify a \"\n                                      \"non-(null) filename argument for the first call.\",\n                                      cimglist_instance);\n        else { cimg::mutex(9); cimglist_for(filenames,l) if (!filenames[l]) { index = l; break; } cimg::mutex(9,0); }\n        if (index<0)\n          throw CImgIOException(_cimglist_instance\n                                \"load_video(): File '%s', no video reader slots available. \"\n                                \"You have to release some of your previously opened videos.\",\n                                cimglist_instance,filename);","sourceCodeStart":67337,"sourceCodeEnd":67373,"githubUrl":"https://github.com/Yalantis/uCrop/blob/f788b534b48c144edf786c8cddbf0e029e637804/ucrop/src/main/jni/CImg.h#L67337-L67373","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure a capture stream is opened first (load_video with a valid filename or device index)","Compile with cimg_use_opencv and link OpenCV videoio to enable capture","Check that a camera/device exists (e.g. /dev/video0 on Linux) and is not held by another process","Check the returned list is non-empty before consuming frames"],"exampleFix":"// before\nframes.load_video(0, 30); // device capture\n// after\n#ifdef cimg_use_opencv\nframes.load_video(0, 30);\nif (frames.is_empty()) { /* no frames captured */ }\n#else\n// video capture unsupported in this build\n#endif","handlingStrategy":"fallback","validationCode":"#ifdef cimg_use_opencv\n  frames.load_video(0, fps);\n  if (frames.is_empty()) { /* no capture device */ }\n#else\n  /* capture unsupported */\n#endif","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compile with cimg_use_opencv for device capture","Verify a capture device exists and is free","Always test is_empty() after load_video"],"tags":["cimg","video","capture-device","opencv"],"backgroundTag":"missing-optional-dependency","analyzedSha":"f788b534b48c144edf786c8cddbf0e029e637804","analyzedAt":"2026-09-08T08:36:04.887Z","contentChangedAt":"2026-09-08T08:36:04.887Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}