Search by

content-true / live-swap-face-frame-audit

Content-true

Compare sampled RGB frames and flag abrupt visual changes for manual video review

Package info

github.com/Content-true/live-swap-face-frame-audit

Homepage

pkg:composer/content-true/live-swap-face-frame-audit

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-11-19 02:58 UTC

This package is auto-updated.

Last update: 2026-11-19 03:07:50 UTC


README

A small, dependency-free PHP library that compares two decoded RGB video frames and flags a large visual change. It helps narrow down frames for manual review; camera motion, lighting and compression can also cause a high score.

composer require content-true/live-swap-face-frame-audit
use ContentTrue\LiveSwapFace\FrameAudit;

// Row-major RGB bytes from two 2×1 frames.
$before = [0, 0, 0, 100, 100, 100];
$after  = [0, 0, 0, 200, 200, 200];
$report = FrameAudit::compare($before, $after, 2, 1, 0.15);
// $report: score (0–1), flagged (bool), pixelsCompared (int).

The optional sixth argument is a crop: ['x' => 0, 'y' => 0, 'width' => 1, 'height' => 1]. Decode and align frames before calling this library; it does not read image files or perform face swapping. Keep an unedited baseline and inspect flagged moments during turning, blinking and occlusion. A numerical difference does not establish authenticity or quality. This check can complement a practical review of live swap face previews without sending frames to any service.

Requires PHP 8.1+. Run php -d zend.assertions=1 -d assert.exception=1 tests/smoke.php from this repository to check core behavior. MIT license.