Yes you can use OBS.
There are may options for input (both video and audio) and most also have some adjustment options like cropping the sides.

From your question it seems like you should use Display capture
. But there might be something better like Window capture
. If you use window capture
the recording stays with the selected window even if you are using another window.
There are also more advances options like overlays (e.g. text, picture, another stream like webcam) and multiple audio channels etc.. It also works for both streaming directly (to a service like twitch or YouTube) and recording. There is even an option to output as a virtual webcam (to be used by something like skype, zoom etc.).
OBS is available for both Windows, MacOS and Linux.
To crop without the crop options for input devices:
