What the others have posted is correct. Also, you need to ensure that the camera does not change magnification (zoom) during the video.

1) Even if the person is moving perpendicular to the camera, comparing pixel changes to the size of a known object is not enough. You also need to know the distances of the person and the reference object from the camera. You can understand this easily if you imagine using the sun as the reference object. You would clearly get a ridiculous velocity if you thought the person was running the diameter of the sun in a second or two.

2) If you know the height of the person, and the size of a reference object and the distance to the reference object, you can calculate the distance to the camera from the number of vertical pixels between the top of the head and the bottom of the feet, the number of pixels for the reference object, the distance to the reference object, and the size of the reference object, but you need to smooth (take the max value during each step or some such measure) this number because running involves bending and straightening the legs.

3) You need to determine the speed perpendicular to the camera and the speed toward or away from the camera (by measuring the change in vertical pixels over time) and then add them in quadrature to get the total speed. The velocity, as a vector, involves using a cotangent to get the direction at any given moment.

15,668,517 members

You don't know the angle of the object in relation to the camera, so the only way you can determine anything resembling that is to measure changes in the dimensions of the object you're tracking. This is going to be an approximation at best as the aspect ratios of the 3D object changes in 2D space.