Open Broadcaster Software or OBS is a free and open source software for video recording and live streaming. Black Screen during Display Capture on OBS Studio is a common issue when someone installs it on Windows 10 machine. I faced it myself too. There were a ton of solutions but only few managed to work.
In fact OBS themselves have a guide to troubleshoot this issue. Here are some of the common solutions which might work for you.
1. Switch Off Game Mode
Go to the Start Menu -> Type Game Mode Settings -> Turn off the Game Mode
Game Mode helps to prioritize your gaming experience on Windows 10. Game Mode has a screen record feature of its own and this can interfere with to OBS to cause Black Screen while recording.
2. Change the Graphic Processor
Right Click on OBS Studio Icon -> Run with Graphic Processor -> Choose Integrated Graphics
Sometimes you got to make this change exclusively to force the machine to run OBS using integrated graphics. The reason may be due to the fact that NVIDIA is not able to force OBS to use integrated graphics for some reason. This trick has helped several people to get rid of their Black Screen Issue on OBS.
3. Make Changes to the Graphic Settings (This worked for me)
Go to Start Menu -> Type Graphic Settings -> Choose Classic App -> Click on Browse
Go to C: -> Program Files -> obs-studio -> bin -> 64bit and select obs64 icon
OBS Studio App will be added to the screen. Click on Options and choose Power Saving as graphics preference.
Now restart your OBS studio and your computer if required. Black Screen Issue will go away. You can see your Display Capture on your OBS Studio.
I hope any of the above solutions work for you to get rid of the Black Screen. Have a good time streaming with OBS !