Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV how to interrupt video record with thread

Hi everyone: i facing a problem on interrupt video while hit timestamp. with the following code below it only generate 1 second video per time. i want to make it generate the video by 30 seconds every time. please help me thank you.

for (int ix = 30; ix >= 0 ; --ix)
{
   if (!cap.read(Source))
    {
       cerr << "ERROR! blank frame grabbed\n";
       break;
     }

     vWrite.write(Source);
}
click to hide/show revision 2
retagged

OpenCV how to interrupt video record with thread

Hi everyone: i facing a problem on interrupt video while hit timestamp. with the following code below it only generate 1 second video per time. i want to make it generate the video by 30 seconds every time. please help me thank you.

for (int ix = 30; ix >= 0 ; --ix)
{
   if (!cap.read(Source))
    {
       cerr << "ERROR! blank frame grabbed\n";
       break;
     }

     vWrite.write(Source);
}