H.265 IP cameras first capture the raw footage according to the recording mode you set up, and then encode the videos in H.265 compression after processing the images.
Unlike the H.264 codec that allows for a maximum of 16 x 16-pixel macroblocks to process information, H.265 HEVC security cameras can expand the pattern comparison to sizes up to 64×64 pixel Coding Tree Units (CTUs).
Larger block sizes are more efficient to encode larger frame sizes, like 4K resolution. Other improvements with the H.265 IP cameras, such as improved deblocking filter and motion vector prediction, also contribute to their greater encoding efficiency.
In other words, H.265 CCTV cameras are therefore able to encode videos at the lowest possible bitrate while retaining a certain level of video quality.