Nvidia has integrated hardware which makes it easy to capture games like trainz. Amd has something similar probably.
As far as nvidia, your 980 is powerful enough that you can do vid capture pretty well.
For your gpu i would use true 1080p recording (1920x1080 at 60fps)
Anything higher and you will probably drop frames.
A recording bitrate of 50mbps is plenty for that rate and resolution.
The nvidia driver for doing screen recording is the external plugin: nvidia NVENC H.264 (NVENC.DLL)
The format you record into will most likely NOT be webm, that is a format that is made after you do the recording using an encoder.
You can do the recordings with the nvidia shadowplay also, that uses the NVenc.dll recording method also.
But any method you choose will most likely not do direct encoding into webm.
The free program called TEncoder will covert your recordings into webm. But the program is a bit complex.
https://sourceforge.net/projects/tencoder/