Thank you so much. That did the trick. Now it's working smoothly and RAM & CPU usage is extremely low.
Is there any reason for the switch from V8 to V9 in the built-in recorder by default? I mean, that would be a good fix for #757172.
However, the output file contains lagging and the recording process takes a huge amount of memory and CPU (see bug #757172). So one solution was to use V8 instead of V9. But As you can see in my code, it doesn't work. (If you remove the pipeline option it will work normally using V9, but I didn't know how to pass the v8 encoder option to it).