

Modern CPUs (from like the last 20 years) will throttle down a lot before they actually shut down. Unless your cooling is completely inadequate or somehow broken, shutdowns because of high load just dont happen. I suspect there is something fundamentally wrong with your hardware.
A problem with cooling could also go some way to explaining your performance problems – but it could also just be that your system just doesn’t have the computing power to do what you want it to. The computing demands from video decoding go up dramatically when you go beyond 1080p. If I recall correctly, the Intel Core CPUs with the “U” at the end were the low-energy models (for longer battery life); of course that comes with compromises on the performance side.
The CPU model suggests that this is a laptop, and a fairly old one at that. I would look for things like blocked air ducts or broken fans if I were you. It’s also possible that the thermal compound between your CPU and the CPU cooler has dried out and needs replacing (although laptops of that power class should be using thermal contact solutions that do not dry out), or that contact has lessened for other reasons. Again, if your computer seriously powers down because of load, it’s borderline broken and in need of maintenance.
As for your other question, no RAM cannot help with that. It can hurt if you have too little of it, but once you have enough, the best it can do is not be a bottleneck.
* Edit: Also, make sure you are not setting down the laptop on anything soft, like a blanket, when using it. It will sink in and have its air intakes blocked if you do that.
Saying RAM can help because you can reencode the video to h.264 or h.265 to make use of hardware decoding is more than a bit of a stretch. You can just reencode it to the normal disk instead. Unless it’s the speed of the local block device that’s the bottleneck here (and there’s no indication that it is, and it would be extremely unlikely), using a ramdisk/tmpfs for any part of that is just pointless.