Webcam testing code using opencv

Problems : Webcam initialised properly but a video cannot be rendered.
I think there are problems in line 7.