Basketball footage into highlight reels
Ten minutes of basketball became a 75-second highlight reel and a 30-second vertical cut that follows the play.
- Input
- Ten minutes from one courtside camera
- Output
- 75-second recap and 30-second vertical cut
Inspect the results
Compare the two cuts from the same courtside recording. The wide reel keeps more of the court visible, while the portrait crop follows the play.
How the pipeline runs
Read the implementation guide- Read metadata
- Find cutsNeeds Read metadata.
- Measure motionNeeds Read metadata.
- Speech to textNeeds Read metadata.
- Sample framesNeeds Read metadata.
- Rank playsNeeds Speech to text, Find cuts.
- Find players and ballNeeds Sample frames.
- Cut wide playsNeeds Rank plays, Measure motion.
- Cut tall playsNeeds Rank plays, Measure motion, Find players and ball.
- Build wide reelNeeds Rank plays, Find cuts, Cut wide plays.
- Build tall reelNeeds Rank plays, Find cuts, Cut tall plays.
- Publish reelsNeeds Build wide reel, Build tall reel.
Lines leaving the same step share a color, and a dot marks where they split; lines without one only cross. Point at a step to highlight its inputs and outputs.
What each step does
- Read metadata
- Reads the recording's duration, frame size and tracks.
- Speech to text
- Transcribes any announcer or commentary, in the language it detects.
- Find cuts
- Finds the camera cuts.
- Measure motion
- Marks small changes between frames, from which the templates tell live play from slow-motion replays.
- Sample frames
- Takes a frame every 0.75 seconds, in 30-second windows.
- Find players and ball
- Finds the players and the ball in each frame with an open D-FINE detector.
- Rank plays
- Gemini watches the game and ranks the plays worth showing, with a caption for each.
- Cut wide plays
- Cuts each play as a 1280×720 clip.
- Cut tall plays
- Cuts each play as a 1080×1100 clip whose window follows the ball, or else the players.
- Build wide reel
- Assembles the 75-second 16:9 reel with a title card, lower thirds and an end card.
- Build tall reel
- Assembles the 30-second 9:16 reel from the tall clips.
- Publish reels
- Returns playback URLs for both reels.
Source footage
Ten minutes of a Slovenian women's first league game from one courtside camera.
- Stasil BURJA · GROSBASKET - TRIGLAV 24MAR15 · CC BY 3.0 · Cut, captioned and reframed by Editframe.
Explore more examples
Adapt this pipeline
A hosted run of this example requires an organization with Pipelines and LLM steps enabled.