@Weyoun: tried both self-built and pre-built from MacPorts, but in any case, that was not the problem. I have run into a similar problem with x264 in the past, but it was fixed sometime around 1.5 years ago. It turns out x265 must still have the same(?) bug. A colleague found this patch from almost a year ago that apparently has not made it into the x265 code base. It completely resolves the problem, both for raw YUV and Y4M piped inputs to x265. Highly recommended for anyone needing piped input to work for macOS and Windows.
https://bitbucket.org/multicoreware/x265/issues/341