Pretty sure this similar project appeared on HN a while back, though I can't find the original thread in Algolia:
https://github.com/pfr/VideoSpeedTracker
A more detailed overview of how it works:
https://github.com/pfr/VideoSpeedTracker/blob/master/docs/Vi...