By looking at the OpenCV code in "color.cpp" it looks like the variable "scn" mentioned in the error is the number of channels of the frame, and the conversion type (BGR -> grayscale) requires there to be 3 or 4 channels:
Assertion failed (scn == 3 || scn == 4)
Are you sure your camera isn't providing grayscale images by default? Try commenting out the lines that process the frame and show only the retrieved image and see what you get. Or just put a breakpoint right after the frame capture and inspect the "frame" variable - is it empty? does it have the expected size and so on?