This is not a practical approach and is not buyable. But might give an insight why some of the solutions mentioned in other posts are so expensive.
That said, if you want to combine HDMI video feeds into a single HDMI connection, the device you plug in between needs to terminate the 4 receiving HDMI connections and parse the pixel information and arrange it into a single Video stream. This is a lot of processing, and you need dedicated hardware for that.
One approach that might work is to use an FPGA with the needed amount of HDMI ports. There are IP cores for HDMI of some Vendors like Xilinx which will do most of the work for you. You would need to program logic in a hardware description language to combine multiple of those IP blocks.
FPGAs of this size are expensive, and you might need a license to use the IP blocks. Also, HDMI uses HDCP, which is a content protection system. If you need to play protected content like movies with this solution, that might be difficult.
One solution I found comes from TESmart and might do the trick: https://tesmart.de/products/hdk404-p