← Back to Projects

Live Sports Commercial Blackout Tool

Platform: Windows 11 • Type: Desktop automation
Python OpenCV OCR MSS PyQt6 Windows

Project Overview

This Windows desktop application detects when a live baseball or football broadcast goes to a commercial break. It covers the selected display with a black overlay and mutes the target browser, then restores the picture and audio when live coverage returns.

Technical summary
  • Captures a selected monitor using MSS and analyzes frames with OpenCV.
  • Matches configured scoreboard and broadcast-watermark regions against calibrated templates.
  • Uses football scoreboard OCR as a second signal for recognizing live play.
  • Shows a borderless PyQt6 overlay and controls audio for a selected browser process.

Detection Architecture

The detector samples the selected display and checks regions of interest for visual anchors that indicate live game coverage. Templates, regions, and confidence thresholds are configurable, allowing the profiles to be tuned for different broadcast graphics and display layouts.

Football mode supplements image matching with OCR. It looks for a game clock alongside a period or down-and-distance cue, providing another indication that the broadcast is showing live play. The app includes baseball and football profiles and can switch between them after confirming the alternate sport over multiple frames.

A separate badge-detection mode supports on-demand content by looking for an on-screen ad or commercial indicator.

Reliable State Changes

Broadcast graphics are not always present: scoreboards can disappear during replays, while a channel logo may remain visible through an ad break. The app uses debounce and grace periods to handle brief changes without rapidly switching states.

Returning from a blackout requires stronger evidence than keeping the picture visible. Recovery requires a confirmed scoreboard match or football OCR rather than relying on a familiar channel logo alone. This helps avoid restoring the picture prematurely when the broadcast is still in a commercial.

Windows Integration and Configuration

When a break is confirmed, a borderless, always-on-top PyQt6 window covers the target display and the audio component mutes the selected browser process, such as Chrome, Brave, or Edge. Once live content is confirmed, the overlay is removed and audio is restored.

Monitor selection, browser executables, capture rate, templates, and detection thresholds are configurable. Calibration commands and status logs help inspect detection behavior and troubleshoot missed or premature transitions.

Limitations

This is visual detection, not a universal way to identify every advertisement. Broadcast layouts vary by sport and network, and OCR or template matching can miss unfamiliar graphics or mistake similar ones for a match. Additional broadcasts may require their own calibrated templates and tuning.

Project Links