For a Mac computer, there's really only one option - Screenflow.
For a Windows computer, I can there are three different programs that stand out:
FRAPS - $37 USD
FRAPS is most likely the best-known screen/game recording program.
There is a trial version which allows you to record for 30 seconds and leaves a watermark.
The full version costs $37 USD, and removes the length cap and watermark.
It has one large downfall - you need a good computer to run it. Seeing as you're getting 30-40 FPS, FRAPS is definitely
not the program that is suited for you.
FRAPS will automatically lock your FPS at what it deems to be a stable FPS - on my old computer which could easily get 60 FPS, FRAPS locked my FPS at 20. On my new computer which virtually never drops below 250 FPS, FRAPS locked my FPS at 90.
Dxtory - Price unknown, but definitely above $30.
This program is also very good, but is slightly less resource intensive, meaning it's easier to run on a not-very-good computer.
It has many more options and settings that you can play with, but those settings can make it a bit confusing at first. If you plan on using Dxtory, make sure that you download, install, and use something called "Lagarith Lossless Codec". You can Google search it, and find a YouTube tutorial.
While it is not as resource-intensive as FRAPS, you still need a fairly good computer (60+ FPS) to use. Dxtory can also lock your FPS, but is not as strict as FRAPS.
Open Broadcastwe Software - Free
Also called OBS, this program is probably the least laggy out of the programs listed. It is decently configurable, but what makes it stand apart from the rest is its price (or lack thereof), the fact that you can record different Scenes and Sources, and it's capability to
livestream to websites like Twitch.TV.
For your purposes, I would recommend using
Open Broadcaster Software. Free, the least laggy, and highly adjustable.
https://obsproject.com/