Motion Capture software. These days there are a number of software apps that do that. No longer exclusively the domain for 3D character animation. It can even be done after the video is taken, using software applications like Adobe Aftereffects where you can define any point in the frame and the computer software will follow the defined point around the frame. So long as the object is always within the frame it is really easy to set up.