It's probably overheating. Check your temps when running it. http://www.cpuid.com/softwares/hwmonitor.html
I downloaded "Core Temp" and found that it was in fact overheating. I opened up my laptop and the heat sink was packed with dust and lint.So I took the fan apart and cleaned it I also replaced the cpu paste with new stuff. My laptop is running like new again and no problems with handbrake.
Thank you for your insight.