by shubla » Sat Jun 30, 2018 11:08 pm
If you use x264 codec/encoding, it will use your CPU. HnH is a quite CPU-intensive game, so recording the game while playing causes poor performance. Changing the software most likely does not help.
If you have somewhat recent NVIDIA GPU you can use other encoding setting, NVENC, which uses your GPU instead of your CPU, thus probably resulting in better HnH peformance (assuming that your gpu does not suck).
The downside with NVENC is that you will need a much larger bitrate for recent quality video capture. This becomes a problem especially if you are streaming the game, as there is no time for additional encoding, some sites might not support high bitrates, causing lag in the stream to the viewers. If you are just recording the game as a video for later use, this is not an issue. But with higher bitrates you will (obviously) need more disk space for the video.
One trick for streaming with NVENC is to have two computers, with one you can play the game and record it with NVENC. Then you stream the video recorded by the NVENC to another computer, which is running ffmpeg which encodes the high-bitrate NVENC stream to lower-bitrate x264 stream. You can then send this to (even multiple) streaming sites with nginx or equivalent. The second computer does not have to be that powerful, as you can fully dedicate all its cpu cores for the encoding task.
With correctly set up LAN, you dont even have to transmit the video to the other computer via internet, which is good to reduce the latency, and bandwidth usage, if you have bad internet.
Java is not the most efficient, but the problem is most likely not caused by java.