This should work, no idea the for the reason of crash. Do you run x64 version? Otherwise low memory could be the issue.
For the command line you have to also put pix_fmt of the rawvideo:
example ffv1
Code:
-f rawvideo -pix_fmt %(pix_fmt) -s %(width)x%(height) -r %(fpsnum)/%(fpsden) -i - -c:v ffv1 %(tempvideofile)
prores
Code:
-f rawvideo -pix_fmt %(pix_fmt) -s %(width)x%(height) -r %(fpsnum)/%(fpsden) -i - -c:v prores_ks -profile:v 4 -pix_fmt yuv444p10 "%(tempvideofile)"