-1

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.

user3471546
  • 381
  • 1
  • 6
  • 17
  • does that demo code use cv::VideoCapture to access the live video? put the filename to its constructor to perform same code on video file ... – Micka Jul 02 '15 at 05:30

1 Answers1

0

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;
chr0x
  • 1,151
  • 3
  • 15
  • 25