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?
Did you try it? What is your problem?
Yeah. The video file does not play, which I believe is due to the write() not working as intended. Technically, those two lines should be enough, right? The current_frame shows nicely with imshow if it's relevant.