Vid-Repair 🎬🛠️

Vid-Repair is a crossplatform CLI that scans video files for container/stream/decode problems and applies safe repairs using your system ffmpeg/ffprobe.

Quick Start 🚀

Requirements

  • ffmpeg and ffprobe available on PATH
  • Rust + Cargo (install via rustup: https://rustup.rs)

Clone 📦

git clone https://git.44r0n.cc/44r0n7/vid-repair.git
cd vid-repair

Install 🧰

cargo build --release

To install the CLI from the workspace root:

cargo install --path ./vid-repair

(cargo install --path . will fail because the repo root is a workspace manifest.)

Common commands 💻

# Most users: scan + fix in one step
vid-repair fix /path/to/videos

# Scan only (no changes)
vid-repair scan /path/to/videos

# Watch a folder and scan new/changed files once they finish writing
vid-repair scan --watch /path/to/videos

# Fix with aggressive policy (allows re-encode)
vid-repair fix --policy aggressive /path/to/videos

# JSON output (for scripts)
vid-repair scan --json /path/to/videos

Note: fix always performs a full scan first, then repairs only if issues are found.
Use scan when you just want a report without making changes.

Scan depth 🔎

# Quick scan (faster, less thorough)
vid-repair scan --scan-depth quick /path/to/videos

# Standard scan
vid-repair scan --scan-depth standard /path/to/videos

# Deep scan (default, full decode)
vid-repair scan --scan-depth deep /path/to/videos

Recursive vs nonrecursive 🧭

# Disable recursive scanning
vid-repair scan --no-recursive /path/to/videos

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

You can edit this file to set defaults like scan depth, include/exclude patterns, and watch behavior. CLI flags always override config values.

AI Disclaimer 🤖

This software was written with assistance from OpenAI Codex.

Developer Guide 🛠️

This section is for contributors and anyone building on the project.

Project layout 🧱

  • vid-repair/ CLI binary
  • vid-repair-core/ core library (scan, rules, fix, report, watch)
  • rulesets/ modular rule packs (TOML)
  • scripts/ helper scripts (fixtures, checks)

Rulesets 🧩

Rules are datadriven and split by domain in rulesets/*.toml.
When running an installed binary, the first run will autoinstall the default rulesets into the XDG data directory (for example ~/.local/share/vid-repair/rulesets on Linux). Before shipping changes:

vid-repair rules lint

Fixtures 🧪

Generate fixtures locally (gitignored):

scripts/generate_fixtures.sh

Use fixtures to validate scan logic and rule coverage. Add new fixtures for realworld edge cases (truncated files, corrupted NAL units, etc.).

Tests

scripts/check.sh

This runs the full test suite and ruleset lint.

Description
Rust CLI to scan and safely repair video files via ffmpeg/ffprobe (rulesets, watch mode, in-place fixes).
Readme MIT 147 KiB
Languages
Rust 97.7%
Shell 2.3%