There were videos like this that involved throwing ping-pong balls into a cup from insane distances or with unlikely obstacles. It's similar to motion capture, I can't recall the exact name of the process, but believe it involves frame by frame editing.