Metadata-Version: 2.4
Name: runrazor
Version: 0.5.3
Summary: RunRazor: movement-analysis tools for stationary-camera footage
Author: Ken Walker
License-Expression: MIT
License-File: LICENSE
License-File: THIRD_PARTY_LICENSES
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Multimedia :: Video
Classifier: Environment :: Console
Requires-Dist: gpxpy>=1.6.2
Requires-Dist: numpy>=2.0
Requires-Dist: scipy>=1.13
Requires-Dist: matplotlib>=3.9
Requires-Dist: click>=8.1
Requires-Dist: pyside6>=6.8
Requires-Dist: pyopengl>=3.1.7
Requires-Dist: python-mpv>=1.0.8
Requires-Dist: opencv-python>=4.9
Requires-Dist: click-option-group>=0.5.9
Requires-Dist: markdown>=3.6
Requires-Dist: onnxruntime>=1.17
Requires-Dist: pyobjc-framework-cocoa>=10.0 ; sys_platform == 'darwin'
Requires-Python: >=3.11
Description-Content-Type: text/markdown

﻿# RunRazor

Tools for movement analysis from stationary-camera footage.

If you film yourself or someone else repeating a course past a fixed camera -- hill repeats, sprints, drills -- RunRazor turns that raw footage into usable clips. It can use the subject's GPS track to find each pass automatically, or you can mark the cuts by hand. It can crop and follow the subject so they stay framed, and lets you compare runs side by side or export the cuts straight to a video editor.

### Demo
[![RunRazor demo](https://img.youtube.com/vi/UskoAXLP1Ic/mqdefault.jpg)](https://www.youtube.com/watch?v=UskoAXLP1Ic)

| Command | What it does |
| --- | --- |
| `runrazor` | The main app: extract clips from a video using GPS or manual cut points, review and tune the cuts, reframe, annotate, compare, and export (see `rrdocs runrazor`) |
| `rrreframe` | Crop and follow a moving subject automatically so they stay framed (see `rrdocs reframe`) |
| `rrcompare` | Play two runs side by side, lined up in time, to compare them (see `rrdocs compare`) |
| `rrtag` | Mark matching points in two runs by hand so `rrcompare` can line them up (see `rrdocs compare`) |
| `rrdocs` | Open the bundled documentation in your browser |

## Setup

RunRazor needs Python 3.11+, **ffmpeg** (with `ffprobe`) on your PATH, and **libmpv** for GPU-accelerated video playback.

### Windows

Install prerequisites using [winget](https://learn.microsoft.com/windows/package-manager/winget/) (built into Windows 10/11):

```
winget install Python.Python.3.12 Gyan.FFmpeg mpv.net
```

Close and reopen your terminal so the new `python` and `ffmpeg` commands are on your PATH, then install RunRazor:

```
pip install runrazor
```

To update: `pip install --upgrade runrazor`

### macOS

Install prerequisites using [Homebrew](https://brew.sh):

```
brew install python ffmpeg mpv pipx
```

```
pipx install runrazor
```

To update: `pipx upgrade runrazor`

### Linux (Debian/Ubuntu)

```
sudo apt update
sudo apt install python3 ffmpeg libmpv-dev pipx
pipx install runrazor
```

To update: `pipx upgrade runrazor`


## RunRazor Application

The main application ties all the tools together: load a video (and a GPS track, if you have one), review and tune the cut points against the footage, reframe, compare, and export as an editor timeline (FCPXML/EDL) or a stitched MP4.

```
runrazor
```

See `rrdocs runrazor` for all options, hotkeys, time format, and examples.


## Reframe

Automatic subject tracking and reframing pipeline.  Crops video from a stationary camera to follow a moving subject.  You can use this directly without the RunRazor segmentation. 

```
rrreframe input.mp4
```

You may get reasonable results without any additional arguments. 

See `rrdocs reframe` for fine-tuning, the neural-network detector, handheld mode, deshake, horizon correction, 360 video input, interactive mode, profile mode, and cache options.

## Split-screen comparison

Side-by-side comparison of two ski runs (or one run against its own mirror), phase-locked turn-by-turn. It runs on Reframe outputs: each clip's trajectory sidecar (written by default) drives automatic turn-apex detection, and one clip plays at native speed while the other is retimed per turn segment to stay in sync.

```
rrreframe runA.mp4 --output a.mp4
rrreframe runB.mp4 --output b.mp4
rrcompare a.mp4 b.mp4 -o compare.mp4
```

To compare against an external clip that was never reframed (or to fix wrong auto-detected turns), tag its apexes with `rrtag clip.mp4`. See `rrdocs compare` for turn pairing, mirroring, pane fit, retiming, manual tagging, and the editable alignment JSON.

## Licenses

runrazor is released under the MIT License (see `LICENSE`). It bundles a default subject detector -- the stock **YOLOX-Nano** model (Apache-2.0, Copyright (c) Megvii Inc.), used under the COCO "person" class. Full attribution and license text are in `THIRD_PARTY_LICENSES`. For higher accuracy, the larger permissively-licensed **YOLOX-S** can be dropped in via `--nn-model` (see `rrdocs reframe` and `training/README.md`).

---

&#x2744;&#x1F917;&#x2744; 
