I'd like to build a beginner-friendly program that monitors a livestream of an original Super Mario Bros. speedrun and alerts me when the runner reaches important points. In particular, I want a notification when the game reaches World 8, and possibly another when the run reaches level 8-4.
The world and level counters appear in consistent locations on screen. I'm wondering whether Python could periodically inspect the stream, identify the displayed number, and send a notification to my phone. I'm new to programming and would prefer to learn how to build it myself rather than rely on an AI-generated solution. What approach would be easiest to start with?
5 Answers
If there isn’t a useful tracking API, you can make a basic screenshot-based version. Leave the stream running on a computer, use Python to capture a frame every 10 seconds, crop the small region containing the world counter, and compare it with reference images for the numbers you care about. Once the cropped image matches the 8, send an email or notification through a service such as Telegram. You’ll also want safeguards so a blocked, paused, or refreshed stream doesn’t trigger a false alert.
Visual recognition is possible, but capturing and decoding a livestream is the part that tends to make this difficult for a beginner. If you do use video, begin with a local recording or screenshots, isolate only the counter region, and test against different scaling and brightness conditions. After that works, connect the script to the stream and add a notification service.
You probably don’t need a full machine-learning system. Since the counter stays in one place and the game’s graphics are consistent, crop that fixed area and use simple template matching or OCR. Start with screenshots saved locally rather than a live stream: make sure your script can recognize the counter reliably, then add periodic capture, duplicate-alert prevention, and notifications. Sampling once every 10 seconds should be enough for a milestone that lasts through an entire level.
The simplest approach may not involve analyzing the video at all. Check whether a live-tracking site, stream-data endpoint, or chat bot already reports the current world or level. A Python script could poll that text data every few seconds and send a push notification through a service such as Pushover when the value changes to World 8 or 8-4. Search for live tracking for the specific event first; using existing structured data will be much easier than processing video.
Another low-tech possibility is to monitor audio or chat instead of the picture. A recognizable sound sequence occurs around some major points, and chat activity may spike when an exciting milestone happens. Audio matching would require signal-processing work, while chat-rate detection is easier but can produce false positives. These approaches are worth considering if reliable stream metadata isn’t available.

How would I actually set up the screenshot capture, image matching, and phone notification? I’m not sure which libraries or services to start with.