I've used SimpleScreenRecorder for screencasting. The settings are shown below. This file is of very good quality. I've then added this clip to the Kdenlive project with the same settings as the video. To test the output, I rendered some 5 to 10 seconds of the video and the final result was not good as the source file. The bitrate and other settings during rendering are shown below.