There are many programs to record video from display. But what if you need to record video from two, three or ten displays? You need OBS Studio.
This is auto translated version of this post.
Select the recording source
You can't just start OBS Studio and hit Record button. To start recording you need to select the source. This can be a screen, an application, or a web camera.
If you have primary monitor in the Source list just select it and skip the next step.
Otherwise, remove all the sources, click "+" in the corresponding block and select screen Capture.
In the next window you can specify the name of the source. I called it Monitor 1.
Click OK and select the primary monitor in the list.
Add a second monitor in the list of sources same way.
How to record video from two monitors at once
By default, OBS will record video with a single monitor. Therefore, it is necessary to make another small adjustment.
Click on the settings button in the lower right corner.
In settings go to Video and expand the Base the resolution. And select a resolution that width will be equal to the resolution of both monitors (or most). Click Ok.
Now you need to align the images of both monitors in OBS and then just press to Start recording.