The Story
Tonight is the ICC World Cup finals between India and Pakistan. Millions are watching the match live, and the competition to post match highlights — sixes, wickets, and spectacular catches — on social media is fiercer than ever. In the usual workflow, someone watches the match, waits for a moment to happen, then clips the video manually and uploads it online — often several minutes too late. But we have a smarter way. What if AI could monitor the match for you, detect key moments in real-time, and instantly send alerts when something exciting happens — giving you a headstart on posting highlights while everyone else scrambles?What You’ll Build
With VideoDB RTStream, you can build a system that:- Monitors live cricket feeds continuously
- Detects key moments: sixes, fours, catches, and wickets
- Sends real-time alerts when highlights happen
- Provides instant video clips for social media sharing
Setup
Install Dependencies
Connect to VideoDB
Implementation
Step 1: Connect to the Cricket Stream
Step 2: Index Scenes with Cricket Analysis
Create a scene index that analyzes the cricket match continuously. The batch config is tuned to capture the fast-paced nature of cricket - analyzing every 7 seconds with 7 frames for detailed action detection.frame_count: 7 captures the rapid action of cricket, ensuring key moments aren’t missed.
Step 3: Define Four Highlight Events
Create events for each type of highlight that matches your indexing prompt:Step 4: Attach Alerts for Each Highlight
Create alerts for all four events on the same webhook:label field indicating which highlight was detected.
What You Receive
When a highlight is detected, your webhook receives an alert with the exact moment and video clip:The Result
With this setup in place, broadcasters and content creators no longer have to wait, clip, and scramble. They can stay ahead of the crowd, instantly catching and sharing match-defining moments as they happen — turning every six, four, wicket, and catch into social media gold within seconds.Explore the Full Notebook
Open the complete implementation with additional features and helper functions for match analysis.