73 lines
1.5 KiB
Markdown
73 lines
1.5 KiB
Markdown
# Vid-Repair
|
||
|
||
Vid-Repair is a cross‑platform Rust CLI that scans video files for container/stream/decode problems and applies safe repairs using system `ffmpeg`/`ffprobe`.
|
||
|
||
## Features
|
||
|
||
- Scan: ffprobe metadata + ffmpeg decode pass
|
||
- Data‑driven rulesets (TOML) with linting
|
||
- Safe fix planning (remux/faststart) + optional aggressive re‑encode
|
||
- Atomic replace + optional keep‑original
|
||
- Watch mode with settle window
|
||
- Text output by default, JSON with schema version
|
||
|
||
## Requirements
|
||
|
||
- `ffmpeg` and `ffprobe` available on PATH
|
||
|
||
## Install
|
||
|
||
```bash
|
||
cargo build --release
|
||
```
|
||
|
||
## Usage
|
||
|
||
```bash
|
||
# Scan
|
||
vid-repair scan /path/to/videos
|
||
|
||
# Scan and watch for new files
|
||
vid-repair scan --watch /path/to/videos
|
||
|
||
# Fix (safe policy, in-place)
|
||
vid-repair fix /path/to/videos
|
||
|
||
# Fix with aggressive policy
|
||
vid-repair fix --policy aggressive /path/to/videos
|
||
|
||
# JSON output
|
||
vid-repair scan --json /path/to/videos
|
||
|
||
# Lint rulesets
|
||
vid-repair rules lint
|
||
```
|
||
|
||
Exit codes:
|
||
- `0` no issues
|
||
- `1` issues found
|
||
- `2` fix failed
|
||
- `3` fatal error
|
||
|
||
## Config
|
||
|
||
On first run, a commented TOML config is created in the XDG config directory:
|
||
|
||
- Linux: `~/.config/vid-repair/config.toml`
|
||
- macOS: `~/Library/Application Support/vid-repair/config.toml`
|
||
- Windows: `%APPDATA%/vid-repair/config.toml`
|
||
|
||
CLI flags override config values.
|
||
|
||
## Rulesets
|
||
|
||
Rules are stored in `rulesets/*.toml`. Use `vid-repair rules lint` before shipping changes.
|
||
|
||
## Fixtures
|
||
|
||
Generate fixtures (git‑ignored) with:
|
||
|
||
```bash
|
||
scripts/generate_fixtures.sh
|
||
```
|