What are supported stream formats for h.265
That command isn't well-formed. First, you specify copy, then specify a raw HEVC format with HEVC encoding and then RTSP as an output format.

Try

ffmpeg -f image2pipe -vcodec mjpeg -i - -vcodec libx265 -f rtsp rtsp://10.31.5.126:1935/app2/myStream