I use https://obsproject.com/ to record everything for the last 10 years, it does the job the set up might be pain but from last time I checked on first installation the default settings are good for a huge amount of laptops and PCs.
All my recordings are from replays but I could set up some video buffer into OBS but I am too lazy (basically it clips the last 60 seconds into a video and save it with a press of a button), for replay I just press Ctrl + Shift + E before inspecting a hero to disable the ugly top UI and Ctrl + Shift + O for the replay box. Then press from 0 to 9 to inspect a player (mostly me because I am the most important person in this replay, like you are being the most important person in your replay).
The downside is the map is not visible though.