---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

1.  [](/)
2.  [Code examples](/recipes)
3.  Sports Highlights Pipeline

Back to code examples

QualitySimilar

# Sports Highlights Pipeline

Automatically identify highlight-worthy moments in sports broadcasts using multimodal analysis, visual action detection, audio spike recognition (crowd noise, commentator excitement), and on-screen graphic parsing. Returns timestamped event manifests ready for clip assembly.

video

audio

text

Production

[Run in Builder](/build?recipe=sports-highlights)

### Why This Matters

Reduces highlight turnaround from 4-8 hours of manual editing to 15-20 minutes of automated processing. Captures 95%+ of key moments vs ~65% with human editors working under time pressure.

Python

cURL

import requests

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="sports")

API \= "https://api.mixpeek.com/v1"

HEADERS \= {"Authorization": "Bearer YOUR\_API\_KEY", "X-Namespace": "sports"}

\# 1. Game footage, cut at scene changes, with commentary transcripts and embeddings

bucket \= client.buckets.create(

    bucket\_name\="sports-footage",

    bucket\_schema\={"properties": {"broadcast": {"type": "video"}}},

)

collection \= client.collections.create(

    collection\_name\="game-scenes",

    source\={"type": "bucket", "bucket\_ids": \[bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

        "parameters": {

            "split\_method": "scene",

            "run\_transcription": True,

            "run\_transcription\_embedding": True,

        },

    },

)

client.buckets.upload(

    bucket\["bucket\_id"\],

    blobs\=\[{"property": "broadcast", "type": "video", "data": "s3://your-bucket/games/cl-final.mp4"}\],

)

client.collections.trigger(collection\["collection\_id"\])

\# 2. Event exemplars (goal, save, foul, celebration) and the taxonomy over them

example\_bucket \= client.buckets.create(

    bucket\_name\="event-examples",

    bucket\_schema\={"properties": {"clip": {"type": "video"}}},

)

examples \= client.collections.create(

    collection\_name\="event-examples",

    source\={"type": "bucket", "bucket\_ids": \[example\_bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

    },

)

client.buckets.upload(

    example\_bucket\["bucket\_id"\],

    blobs\=\[{"property": "clip", "type": "video", "data": "s3://your-bucket/events/goal-01.mp4"}\],

)

client.collections.trigger(examples\["collection\_id"\])

matcher \= client.retrievers.create(

    retriever\_name\="event-matcher",

    collection\_identifiers\=\["event-examples"\],

    input\_schema\={"query": {"type": "text", "required": True}},

    stages\=\[

        {

            "stage\_name": "search",

            "stage\_id": "feature\_search",

            "parameters": {

                "searches": \[

                    {

                        "feature\_uri": "mixpeek://multimodal\_extractor@v1/vertex\_multimodal\_embedding",

                        "query": {"input\_mode": "text", "value": "{{INPUT.query}}"},

                        "top\_k": 3,

                    },

                \],

                "final\_top\_k": 3,

            },

        },

    \],

)

\# A flat taxonomy matches each document, through a retriever, against a

\# collection of labeled examples. The SDK has no taxonomies resource, so this is REST.

taxonomy \= requests.post(API + "/taxonomies", headers\=HEADERS, json\={

    "taxonomy\_name": "soccer\_events",

    "config": {

        "taxonomy\_type": "flat",

        "retriever\_id": matcher\["retriever\_id"\],

        "input\_mappings": \[{"input\_key": "query", "source\_type": "payload", "path": "transcription"}\],

        "source\_collection": {"collection\_id": examples\["collection\_id"\]},

    },

}).json()

\# 3. The highlights retriever: action and commentary search, event labels, top 20

highlights \= client.retrievers.create(

    retriever\_name\="soccer-highlights",

    collection\_identifiers\=\["game-scenes"\],

    input\_schema\={"query": {"type": "text", "required": True}},

    stages\=\[

        {

            "stage\_name": "search",

            "stage\_id": "feature\_search",

            "parameters": {

                "searches": \[

                    {

                        "feature\_uri": "mixpeek://multimodal\_extractor@v1/vertex\_multimodal\_embedding",

                        "query": {"input\_mode": "text", "value": "{{INPUT.query}}"},

                        "top\_k": 100,

                    },

                    {

                        "feature\_uri": "mixpeek://multimodal\_extractor@v1/multilingual\_e5\_large\_instruct\_v1",

                        "query": {"input\_mode": "text", "value": "{{INPUT.query}}"},

                        "top\_k": 100,

                    },

                \],

                "fusion": "rrf",

                "final\_top\_k": 100,

            },

        },

        {"stage\_name": "label", "stage\_id": "taxonomy\_enrich", "parameters": {"taxonomy\_id": taxonomy\["taxonomy\_id"\], "top\_k": 1}},

        {"stage\_name": "top", "stage\_id": "limit", "parameters": {"limit": 20}},

    \],

)

results \= client.retrievers.execute(highlights\["retriever\_id"\], inputs\={"query": "goal celebration crowd roars"})

for i, doc in enumerate(results\["documents"\], 1):

    print(i, doc\["start\_time"\], doc\["end\_time"\], doc\["score"\], doc.get("thumbnail\_url"))

### Feature Extractors

Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

### Retriever Stages

feature search

Search and filter documents by vector similarity using feature embeddings

filter

taxonomy enrich

Classify documents against taxonomy nodes via vector similarity

apply

limit

Truncate results to a maximum count with optional offset for pagination

reduce

### Documentation

[Sports Media Solution](https://mixpeek.com/solutions/sports)[Sports Highlights Use Case](https://mixpeek.com/use-cases/sports-highlights)

## Frequently asked questions

### Do I need pre-labeled training data for each sport?

You need 5-20 exemplar clips per event type (e.g., 10 goal clips, 10 save clips). These are used as visual exemplars in the taxonomy, no model fine-tuning or annotation tools required.

### How do I handle different broadcast overlays per league?

Configure field\_passthrough to preserve broadcast metadata. OCR via text\_extractor automatically captures on-screen scores, timecodes, and player overlays as structured fields you can filter on.

### What's the minimum clip length for reliable detection?

Scene detection with a threshold of 0.3 and keyframe\_interval of 2 seconds works well for fast-paced sports. Slower sports (golf, cricket) benefit from longer keyframe intervals (5-10s) to avoid over-segmentation.

## Use Cases Using This Recipe

Advanced

7 min

### Sports Highlights

Auto-generate highlight reels from full-length sports footage

24x faster

Highlight generation time

[

sports

](/solutions/sports)[

entertainment

](/solutions/entertainment)

Who It's For

Sports broadcasters, media companies, and content teams processing 100+ hours of live footage weekly

[View Details](/use-cases/sports-highlights)

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Extractor

### Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

Learn more





](/extractors/multimodal)[

Recipe

### Semantic Multimodal Search

Unified semantic search across all content types. Query by natural language and retrieve relevant video clips, images, audio segments, and documents based on meaning-not keywords or manual tags.

Learn more





](/recipes/semantic-multimodal-search)[

Recipe

### Anomaly Detection

Identify outliers and anomalous content using embedding distance from cluster centroids. Flag quality issues, novel content, or items that don't match expected patterns.

Learn more





](/recipes/anomaly-detection)[

Recipe

### Multimodal RAG

Retrieval-augmented generation across video, images, and text. Retrieve relevant multimodal context, then pass to your LLM with citations back to source timestamps and frames.

Learn more





](/recipes/multimodal-rag)[

Recipe

### Video Semantic Search Pipeline

Build a production-ready video search engine that lets users find specific moments across thousands of hours of video using natural language queries.

Learn more





](/recipes/video-semantic-search)[

Recipe

### Semantic Join

Bridge extracted content features with business reference data. Join video clips to product catalogs, detected faces to employee directories, or documents to compliance frameworks-all via embedding similarity.

Learn more





](/recipes/semantic-join)