H.264 - As of 2019, it is one of the most commonly used formats for recording, compressing and distributing videos.
H.265 - A video compression format using more efficient algorithms than H.264, but fewer devices can play it. It requires less bitrate to transmit an identical stream, but more demanding on PC resources.
You can see how to check availibility of codecs for your system in this article.
HW – means that your video card is used for decoding (discrete or integrated).
1) DXVA2 – requires less computer resources, best choice for most players.
2) Quick Sync – more demanding decoder, frame change occurs more smoothly than on DXVA2, but requires a fairly powerful computer. Used by Intel processors only.
3) UVD – a decoder that allows you to get a better picture with losses in Internet traffic. It is used only on AMD equipment.
SW – means your processor is used for decoding.
Optimal choice for low-end hardware is H.264, HW (DXVA2).
Change to it if the Auto didn't recognize it or set it up correctly.