Motion Tracking Possible in blender?

Hi everyone,
I was wondering if motion tracking is possible in blender just like they did in Avatar or Lord Of The Rings.
Its really hard for inserting all those frames for complex animation.

Are there any tutorials out there for these tasks?