Local-first video analysis MVP for turning a raw video file or supported URL into a reviewable shot package, subtitle assets, rhythm data, and a customer-facing report.
This public repository is a sanitized version of a local prototype. It intentionally excludes private videos, generated analysis projects, runtime config, API keys, and customer artifacts.
- Accepts local video files and URL sources supported by
yt-dlp - Builds a canonical local project package
- Generates review video, audio WAV, keyframes, and a contact sheet
- Produces first-pass shot and scene structures
- Produces transcript files when ASR is enabled
- Detects rhythm peaks and a coarse music profile
- Exports client deliverables: HTML report, PDF placeholder, CSV, SRT, JSON
- Provides a local Web UI with no mandatory web framework dependency
- Supports English/Chinese switching in the Web UI and generated reports
- Exports an industrial shot breakdown table where each row maps to one reviewable shot/image unit
This project was built with AI coding agents as part of a local video-analysis workflow. Agent assistance was used for:
- Python package structure and CLI design
- Data schemas for media packages, shots, scenes, transcripts, beats, and reports
- FFmpeg/yt-dlp workflow planning
- Report synthesis and bilingual HTML generation
- Web UI iteration
- Error handling and local-first file layout
- README and implementation documentation
The next model-integration target is Xiaomi MiMo. Planned usage includes Chinese shot descriptions, subtitle summarization, report drafting, visual prompt generation, and model comparison for video-analysis workflows.
Required command-line tools:
ffmpegffprobeyt-dlpfor URL ingest
Optional:
whisperfor speech transcriptionwkhtmltopdffor true PDF renderingfastapianduvicornfor the optional API module
Python:
- Python 3.11+
pydantic
Install in editable mode:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .Run a fast first pass without ASR:
PYTHONPATH=src python3 -m video_analysis_mvp.cli \
--workspace ./analysis-projects \
run /path/to/video.mp4 \
--profile ads \
--skip-asrRun with a supported URL:
PYTHONPATH=src python3 -m video_analysis_mvp.cli \
--workspace ./analysis-projects \
run "https://example.com/video.mp4" \
--profile festival \
--skip-asrStart the local Web UI:
PYTHONPATH=src python3 -m video_analysis_mvp.cli \
--workspace ./analysis-projects \
serve --port 8787Open:
http://127.0.0.1:8787
Each project is written under:
analysis-projects/<project-id>/
Customer-facing files:
reports/report.htmlreports/overview.pdfreports/shot_breakdown.csvreports/transcript.srtreports/music_rhythm_summary.jsonassets/contact_sheet.jpgassets/keyframes/project_manifest.json
Machine-readable files:
data/media_package.jsondata/shots.jsondata/scenes.jsondata/transcript.jsondata/beats.jsondata/music_profile.jsondata/analysis_report.json
Edit these files for human review:
data/shots.jsondata/transcript.jsondata/music_profile.json
Then regenerate:
PYTHONPATH=src python3 -m video_analysis_mvp.cli \
--workspace ./analysis-projects \
report <project-id>shot_breakdown.csv uses a professional review table shape:
shot_noshot_idtimecodedurationframe_refshot_scalecamera_anglecamera_motioncompositionvisual_descriptionsubjectactionlocationonscreen_textdialoguespeech_summarysound_designmusic_statebeat_densityrhythm_notesmotifscontinuity_notesreview_notesconfidence
- Shot boundaries are first-pass estimates, not model-grade scene detection.
- Music style tags are coarse and audit-friendly, not musicology-level classification.
- ASR is available through local
whisper, but can be slow;--skip-asris the recommended first pass. overview.pdfis a placeholder text file unlesswkhtmltopdfis installed.report.htmlis the designed client report.- Runtime config is local and must not be committed.