OpenCV error in Processing 4.0b2

Hello @bhaskar1955,

The example works with:

I did get this error:

And added this delay to correct that problem:

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

Working: