Video encoding is one of the most CPU intensive tasks your computer will ever face, which results in heat... a LOT
of heat. My Macbook Pro regularly reaches 90+ °C while encoding and if your fans and heatsinks are dirty or obscured (say by placing it on a couch or bed) then critical overheating and shutdowns are inevitable.
Try cleaning your vents
and/or elevating your notebook to allow extra airflow around it during encoding, otherwise you may be unlucky enough to have a machine where the design or a manufacturing fault won't allow it to run at 100% for extended periods.