Losslessly convert from RGBA rawvideo to H.264
You are downsampling the chroma, so thin lines will lose definition. Either use full chroma sampling

ffmpeg -y -f rawvideo -s 960x540 -pix_fmt rgba -framerate 60 -i - 
       -c:v libx264 -pix_fmt yuv444p -crf 0 video_demo.mp4


or keep pixels as RGB.

ffmpeg -y -f rawvideo -s 960x540 -pix_fmt rgba -framerate 60 -i - 
       -c:v libx264rgb -crf 0 video_demo.mp4