Step 1: don't reinvent the wheel. OBS is unparalleled in media recording quality, ubiquitous in the modern streaming world, free, and open source. Clip It works as a companion app to OBS. It communicates with OBS to request video frames for processing, and tells it when to record a clip. All of your OBS scenes, recording settings, and overlays will work. If you already have OBS, it will start working right out of the box. If you don't have it, download OBS now.
Step 2: analyze video frames for recognizable signals or triggers. Modern game UIs present a ton of high-quality, high-contrast information about game state and events. Conveniently, they are found in predictable, fixed locations on the screen. Clip It seeks these out and parses them several times per second using a *special blend* of proprietary real time machine learning algorithms.
Step 3: when the system detects a highlight (like a kill in Call of Duty Warzone, or a goal in Rocket League), it automatically saves a clip — no button presses needed!