Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Recording from imshow/matrix, not from webcam

Hi guys, hit a snag on this one. I'm trying to make the simplest recording from a video feed in imshow (Mat current_frame), not from a webcam.

Basically I'm trying to record what happens to a feed in an imshow.

So in my main function, I invoke the following to create the video folder:

VideoWriter cap1("C:\\Users\\Bla3\\Combined.avi", VideoWriter::fourcc('M', 'J', 'P', 'G'), 5, Size(CAP_PROP_FRAME_WIDTH, CAP_PROP_FRAME_HEIGHT), true);

And when I slide a trackbar in my while(1) routine to start recording like this:

if (RecState == 1) {
                        cap1.write(current_frame);
                    }

Should that already do the trick? Am I mising something here?

Thanks.

Recording from imshow/matrix, not from webcam

Hi guys, hit a snag on this one. I'm trying to make the simplest recording from a video feed in imshow (Mat current_frame), not from a webcam.

Basically I'm trying to record what happens to a feed in an imshow.

So in my main function, I invoke the following to create the video folder:

VideoWriter cap1("C:\\Users\\Bla3\\Combined.avi", VideoWriter::fourcc('M', 'J', 'P', 'G'), 5, Size(CAP_PROP_FRAME_WIDTH, CAP_PROP_FRAME_HEIGHT), true);

And when I slide a trackbar in my while(1) routine to start recording like this:

if (RecState == 1) {
                        cap1.write(current_frame);
                    }

Should that already do the trick? Am I mising something here?

Thanks.

Edit: In short, what is the simplest code to just record an imshow without using VideoCapture?