to extract video and move into the newfolder [closed]

asked 2019-04-25 06:44:48 -0600

opencv.org gravatar image

updated 2019-04-25 08:57:50 -0600

LBerger gravatar image

My task to extract the video of 1min before using after trigger here trigger is passing when->it contains datetimeformat(190425132148).I need to convert this format into minute and subtract formatted minute with 1min(21-1) therfore result will be 20:00 the video play from 20:00 and ends in 21:00 exactly 1minute video have to take and save in separate folder but .and I record video for every 5 minutes.I have no idea about this extraction. Below is the code,

   tm exampleTime() 
   {

struct tm tm;

strptime("2019-04-09 14:28:16", "%Y-%m-%d %H:%M:%S", &tm);

return tm;
}

int main() {

    struct tm when;
when = exampleTime();

VideoCapture obj;
Mat frame;

obj.open(recordVideo->getVideoFile(when));

while(obj.read(frame)) {

    imshow("A", frame);

    char exitKeyPress = (char)waitKey(500);   //to terminate
    if( exitKeyPress == ESC_KEY_PRESSED )
        break;
}
obj.release();
edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by berak
close date 2019-04-26 01:33:34.385142

Comments

Sorry, but this is not even an opencv problem and it is off topic

LBerger gravatar imageLBerger ( 2019-04-25 08:59:29 -0600 )edit

please note, that your playback rate is NOT synchronized to any real time clock. whatever you dowith tm or localtime() -- the results will be pure bogus !

berak gravatar imageberak ( 2019-04-26 01:32:07 -0600 )edit

really, opencv is a computer-vision library, while what you need is video editing software.

berak gravatar imageberak ( 2019-04-26 01:33:21 -0600 )edit