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.