I need capture a video stream from my USB webcam, for this i use Opencv 2.4.6 for developing in Java. I follow the steps listed in here
I add the \"C:\\opencv\\build
So, I was having this problem too and I did what you all suggested, it worked fine in my x64 windows, but in a x86 couldn't make it work.
At last I found a solution by changing:
VideoCapture capture = new VideoCapture(0);
for
VideoCapture capture = new VideoCapture();
capture.open("resources/vid.MP4");
I don't know why this worked but I hope it may help somebody with my same problem.