Ask Your Question

how to display a webcam video on win32 window

asked 2012-07-12 05:52:39 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi, There i need to show cam capture video on win32 windows application. is there any way to show video on win32 windows application.

Thanks, Yogendra

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-07-12 06:08:50 -0500

Daniil Osokin gravatar image

Hi! You can use VideoCapture class for that. Here the sample:

VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
    return -1;
    Mat frame;
    cap >> frame; // get a new frame from camera
    imshow("video", frame);
    if(waitKey(30) >= 0) break;

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2012-07-12 05:52:39 -0500

Seen: 2,073 times

Last updated: Jul 13 '12