answered Nov 21 '18
I use opencv 3.0.0
quite outdated (support for VFW has been entirely removed in current 4.0.0)
try to use:
VideoCapture(0 + CAP_DSHOW);
instead (not magic numbers)