library_run: --origin-root to redo files the old settings bloated, sourced from the snapshot

The old runner (fixed -cq 27 + fixed 256k audio + maxrate at 1.5x the FILE bitrate) left 54 files
BIGGER than their originals - the worst at 124.8%. Re-encoding those from their current HEVC would
be second-generation loss, so the source must be the pre-conversion original; a dated snapshot of
the library holds it (582 files / 324 GiB measured).

A file already HEVC is now re-done only when it is bigger than its original (>1.01x), which makes
the run idempotent with no extra state. The tier and every gate use the ORIGINAL, dst stays the
live path, and os.remove(src) is suppressed whenever the source came from the origin tree so the
archive of originals can never be deleted by a replace.
This commit is contained in:
2026-10-07 06:11:26 +08:00
parent 97f34b90e7
commit 6a60bb92c4
3 changed files with 69 additions and 10 deletions
+7
View File
@@ -300,6 +300,13 @@ table and every CPU/threading knob: **`references/hevc-conversion-policy.md`**.
## Support files
- `scripts/library_run.py` — the whole-library driver that enforces the policy above: bpp tiering
(copy / nvenc / x265), `-maxrate` at 1.0x the source **video** bitrate + a size assertion, a
per-frame SSIM gate with a one-step quality retry, audio matched to the source, local staging,
SHA-256 read-back before an atomic replace, a JSONL ledger, a run lock, E-core pinning for the
CPU tier, `--tier` to run tiers separately, `--dry-run` for the classification plan,
`--keep-local` to pilot without touching anything, and `--origin-root` to redo files that an
earlier bad setting bloated, sourcing them from a snapshot of the originals (never deleting it).
- `scripts/transcode.py` — the tool. `--dry-run`, `--codec`, `--cq/--crf`, `--audio`,
`--channels`, `--cpu`, `--keep`, `--overwrite`, `--no-decode-check`, `--lock`.
- `references/compatibility-matrix.md` — per-platform codec/container facts with citations,