Skip to main content

NBA Highlights Video Generator

Requires Python 3.15.1 or newer.

Videos

Posted on NBA Full Play Highlights.

Author

Ronen Huang

Time Frame

August 2025 to Present

FFmpeg Build

Download from https://www.gyan.dev/ffmpeg/builds/.

Ollama Build

Download from https://ollama.com/download and pull one time.

ollama pull lfm2.5-thinking:1.2b

NBA Team Abbreviations

  • atl - Atlanta Hawks
  • bkn - Brooklyn Nets
  • bos - Boston Celtics
  • cha - Charlotte Hornets
  • chi - Chicago Bulls
  • cle - Cleveland Cavaliers
  • dal - Dallas Mavericks
  • den - Denver Nuggets
  • det - Detroit Pistons
  • gsw - Golden State Warriors
  • hou - Houston Rockets
  • ind - Indiana Pacers
  • lac - Los Angeles Clippers
  • lal - Los Angeles Lakers
  • mem - Memphis Grizzlies
  • mia - Miami Heat
  • mil - Milwaukee Bucks
  • min - Minnesota Timberwolves
  • nop - New Orleans Pelicans
  • nyk - New York Knicks
  • okc - Oklahoma City Thunder
  • orl - Orlando Magic
  • phi - Philadelphia 76ers
  • phx - Phoenix Suns
  • por - Portland Trail Blazers
  • sac - Sacramento Kings
  • sas - San Antonio Spurs
  • tor - Toronto Raptors
  • uta - Utah Jazz
  • was - Washington Wizards

Manually Make Videos

The full play videos can be made from the reliable play by play rather than the unreliable box score.

from nba_video_generator.src import pipeline

pipeline(
    [
        ("DiVincenzo", "2026-04-20", "min"),
    ], 
    {
        "ffmpeg_path": r"C:\Users\ronen\Documents\Projects\nba_video_generator\src\nba_video_generator\ffmpeg-9.0.2-essentials_build\bin\ffmpeg.exe"
    }
)

A date range can be specified as well.

from nba_video_generator.src import pipeline

pipeline(
    [
        ("Booker", "2026-04-19", "2026-04-27", "phx"),
    ],
    {"ffmpeg_path": r"C:\Users\ronen\Documents\Projects\nba_video_generator\src\nba_video_generator\ffmpeg-9.0.2-essentials_build\bin\ffmpeg.exe"}
)

Process

  1. Specify the player last name (as per NBA.com website), team abbreviation, and date(s) (yyyy-mm-dd).
  2. Programs crawls through play by play by quarter, keeping a list of links and times.
  3. Events within 5 seconds of each other are merged to a single event.
  4. Plays are concatenated together to make the video.

Successfully generated player/team/date videos are recorded in processed_performances.json in the current working directory. Later calls to pipeline() skip dates already recorded; set NBA_AGENT_STATE before importing the package to use a different state-file path.

A video of the process is provided below.

https://www.youtube.com/watch?v=84GDSAL5CeE

Automatically Make Videos With Agent

Makes videos of the LLM determined best player performances of specified date (default today).

from nba_video_generator.nba_agent import run_agent

date = "2026-06-10"

ffmpeg_path = r"C:\Users\ronen\Documents\Projects\nba_video_generator\src\nba_video_generator\ffmpeg-9.0.2-essentials_build\bin\ffmpeg.exe"

run_agent(date, ffmpeg_path)

Process

  1. Specify the date (yyyy-mm-dd).
  2. LLM chooses players from pool of candidates that meet thresholds in src/nba_video_generator/nba_agent/config.py.
  3. The videos are made with the pipeline method. The thumbnails with relevant statistics are made afterward.
  4. (Optional) Upload to YouTube with Python. Example program in src/nba_video_generator/example_youtube_upload_scripts. Link to data api - https://developers.google.com/youtube/v3/guides/uploading_a_video.

A video of the process is provided below.

https://www.youtube.com/watch?v=IC8SrrvS4xE&feature=youtu.be

Automatically Make Game Top Plays Shorts - NEW

Makes shorts of the top 4 plays from each specified date (default today). Made scoring plays are excluded when they occur with 5:00 or less remaining in the fourth quarter and the team was already leading by at least 20 points. Fourth-quarter buzzer-beaters are also excluded unless they tie the game or change which team is leading. When choosing the top plays, scoring prioritizes buzzer-beater winners, buzzer-beater ties, other game-winning baskets, game-tying baskets, first-through-third-quarter buzzer-beaters (1–3 seconds), and-one dunks, and-one threes, and other dunks, in that order; other plays are ranked afterward by their existing style and situation scores.

from nba_video_generator.nba_shorts import make_shorts_for_date

date = "2016-06-19"

ffmpeg_path = r"C:\Users\ronen\Documents\Projects\nba_video_generator\src\nba_video_generator\ffmpeg-9.0.2-essentials_build\bin\ffmpeg.exe"

make_shorts_for_date(date, ffmpeg_path)

Web Interface

Run the video-generation and upload workflows from a local browser dashboard:

python -m pip install --upgrade nba-video-generator
nba-video-generator-web

After the new release is published, install it from PyPI as shown above. The dashboard opens at http://127.0.0.1:8765. It includes forms for the player pipeline (including date ranges and multiple players), the daily agent (load finished games for a date and choose which to analyze), and top-plays Shorts. Each video workflow lets you choose the output folder. When the player pipeline cannot match a steal, block, turnover, or miss to an exact NBA play event, it uses the action ID immediately before the first feed action found at that game clock. Jobs run in the background and stream their output to the activity panel. The YouTube upload workflow lets you select a video folder and Google client_secrets.json using local file pickers. Uploads default to private, preserve local files, and use a saved OAuth token under your home directory. Only one workflow can run at a time. To choose another port or keep the browser closed:

nba-video-generator-web --port 8766 --no-browser

Metadata

Release files for nba-video-generator 8.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nba-video-generator 8.0.9
File Size Uploaded Provenance Actions
nba_video_generator-8.0.9.tar.gz 74.0 kB With provenance Details for nba_video_generator-8.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nba-video-generator 8.0.9
File Interpreter ABI Platform Actions
nba_video_generator-8.0.9-py3-none-any.whl Python 3 none any Details for nba_video_generator-8.0.9-py3-none-any.whl

Total release size: 157.6 kB

Release files / nba_video_generator-8.0.9.tar.gz

Download URL nba_video_generator-8.0.9.tar.gz
Size 74.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0a919e97e209724a7884eed15052d0f13038eb9060c23236c5a6b9fe718c2ebc
BLAKE2b-256 checksum
How to use checksums
39543f78a917cddb348007359b316725445e586b70a58e93df464605c931681e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / nba_video_generator-8.0.9-py3-none-any.whl

Download URL nba_video_generator-8.0.9-py3-none-any.whl
Size 83.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7a40ab8e10d761a4faed4b652a62653ca9390c18664f70432978bc4da23e3f5
BLAKE2b-256 checksum
How to use checksums
7a01dd6c77cbfcc97187594708935938d17744707575fcd40b751a70f7096fc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for nba-video-generator 8.0.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nba_video_generator-8.0.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

8.0.9 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page