在那个位置cvQueryFrame( pCapture )没有定义。你可以试试cvgetcaptureproperty函数,直接得到你采集图像的大小,要不然你运行到// cannyImg =。。。这一句时,cvQueryFrame( pCapture )是空指针
建议你这样写pFrame=cvQueryFrame( pCapture );,再试试
cvWaitKey的时间精度可能达不到你的精度
改变cvCreaterVideoWriter里面的帧率并将cvWaitKey的时间改为1000/帧率