Can anyone recommend the best program to capture action within a game that I maybe currently playing?

Ive tried a number, but between the codecs I have on my machine and the 3D engine, most captures are either to slow or just dont capture in any good quality?

Hopefully there are freeware utilities that do this.