# OpenCV error in Processing 4.0b2

**URL:** https://discourse.processing.org/t/opencv-error-in-processing-4-0b2/33284
**Category:** Libraries
**Created:** [November 3, 2021, 3:42pm UTC](https://discourse.processing.org/t/opencv-error-in-processing-4-0b2/33284 "2021-11-03T15:42:17Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [August 13, 2022, 3:12pm UTC](https://discourse.processing.org/t/opencv-error-in-processing-4-0b2/33284/10 "2022-08-13T15:12:45Z")

</div>

Hello @bhaskar1955,

The example works with:

- Windows 10
- Processing 4.01 (August 9, 2022)
- [Releases · jaegonlee/opencv-processing · GitHub](https://github.com/jaegonlee/opencv-processing/releases)

I did get this error:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/b/7/b7970501fe497b9a05476d52a87b7d19aa722ecf.png)

And added this delay to correct that problem:

```auto
void setup() 
  {
  size(720, 480);
  video = new Movie(this, "street.mov");
  opencv = new OpenCV(this, 720, 480);
  
  opencv.startBackgroundSubtraction(5, 3, false);
  
  println(frameCount, video.width, video.height);
  
  video.loop();
  video.play();
  
  int t1 = millis();
  while (video.width == 0 )
    {
    //println(millis());
    if (millis() - t1 > 1000)
      {
      // Can add a message here if over 1000 ms or 1 s
      }
    }
  int t2 = millis();   
  println(t2-t1, video.width, video.height); 
  }

```

Relate discussion about that error:  
[https://forum.processing.org/two/discussion/23389/resizing-a-movie-possible-bug.html](https://forum.processing.org/two/discussion/23389/resizing-a-movie-possible-bug.html)

Working:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/1/6/168b131a7a7cf01962fb7016d913df5e04973ef2.jpeg)

---

_[View the full topic](https://discourse.processing.org/t/opencv-error-in-processing-4-0b2/33284)._
