I have a video (in webm format), and I want to produce a graph that shows the degree of motion in this video as a function of video time. I'm sure there are many different ways to define "degree of motion", but I envisaged something that could be based on the average difference between pixels in consecutive frames, or something like that (suggestions are welcome). Essentially what I need is a graph whose magnitude is large in cases where there is a very big change in the frames and small when most of the frame stays the same except for a small section.

What tools might I use to achieve this? Thanks in advance.


1 Answer 1


Probably you could try optical flow with some key-points not pixels if your purpose is to estimate motion. I thing meaningful thing would count average values of keypoints, overcomes some threshhold or filter (to eliminate barelly moving keypoints). However there would be some problems with having constant amount of meaningfull keypoints (keypoints tend to dissapear over time and very little chance that same amount newly generated keypoints are on moving objects). If that is what you want. You can estimate amplitudes of moving keypoints. Tools could be any CV library like OpenCV. Pixels are not easily trackable without being extracted as keypoints.

On the other hand if you want to estimate how much pixels moving on image and estimate movement results from codec movement compression you could extract frame by frame and ignore I type frames and count how much pixels are on B and P type frames (I am recalling from h264 not sure how these frames are expressed in vp8), which are just moving picture parts from previous/next frame. You then can have estimate how much pixels are moving. Your call how you will implement this.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.