. . . . takes too long recording a video in mp4 . . . . a 40 minutes video takes one hour aproximatelly . . . .
Do you mean exporting the 40 min recorded video to MP4 takes approximately one hour?
If so the export time depends on:
your computer specification - please supply as @PATIENT-X has asked - see this topic for details of what is required and my Signature as an example
Hardware acceleration being available - we can determine this from (1)
effects, eg sharpening, transitions and titles used - give details if any were added
The export preset you are using - post a screenshot of the export dialog you are using.
If you are upscaling the video from a lower resolution and/or changing framerate - what was the original video resolution and framerate - a MediaInfo analysis of the recorded video would help - post the results (copy and paste) from the Text view