Render an animated object inside an irl video
You are looking for a tutorial like "match track blend"

https://www.youtube.com/playlist?list=PLtuvwW4VAp5tu2RdbRHThM6FVFfvFur1g

and simpler from Blenderguru

https://www.youtube.com/watch?v=wjWoglMYXBE

which is to comprehensive to be covered in a single answer.

As you seem to be fairly new, I suggest you look through the list 

Resources for Blender