简体   繁体   中英

How to detect motion from already store webm video in c++

I want to detect motion in already existing video, The video is stored in the webm format. I have seen some demo of opencv but those samples is capturing the motion of the live webcam streaming.

Is there any library or api which capture the motion of the webm video file in c++?

please help me.

If you have the code that run with the webcam input you only have to change the input type to accept the video file as input.

Basically, you can accomplish it using the VideoCapture object.

cv::VideoCapture cap("path/for/file.fileextension")

and then, putting this input into a Mat datatype (separating by frame):

Mat frame;
cap >> frame;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM