Estimation of an objects velocity in a video

I would like to calculate the velocity that the horse is moving in a video like below
I have a known distance on the horse itself so I can calculate the distances on the horse, but as the camera is ‘walking with’ the horse, I am unsure how to calculate the velocity of the horse (I presumed Optical Flow?). Any ideas appreciated

Here are some ideas:

Yes, you can use optical flow or any feature2d matching to get the background velocity in pixels/frame. You can average the velocity vectors over the background, you can use a ROI to avoid the vector over the horse.

For the speed in m/s you need more info, like the distance in meters from frame’s left to right, and the time between frames (fps inverse). With this data you can scale pixels/frame to m/s .

Is the camera only translating in the same direction as the horse? (no zoom or rotation?) If so, is it possible to know how how fast the camera is moving (like is it on a robotic platform, or something with a speedometer of sorts) If so you can use that as the baseline speed of the horse, then adjust based on the position of the horse in the image (scaled by the known “distances on the horse”)

Just a different approach to consider.