Ahmed Doghri Logo Image
Ahmed Doghri

physicsvideo

Generated motion still owes physics an explanation. physicsvideo checks tracked trajectories for gravity, teleports and permanence gaps, measured across 400 randomized clips: every planted fault caught, no false alarms.

physicsvideo generated film physical consistency test
physicsvideo working browser demo

Plausible Frames Can Make Impossible Motion

A generated clip can look sharp frame by frame while an object accelerates upward under gravity, teleports across the scene, disappears for a while, or ignores a collision it was told about.

physicsvideo evaluates tracked trajectories with explicit tests for acceleration, displacement jumps, visibility gaps, and velocity reversal, then renders the scenarios to real MP4 files you can watch.

The Demo

Five scenarios: one clean control and four targeted faults. The benchmark catches all four and raises nothing on the control.

It tests supplied tracks and declared events. General video still needs reliable tracking, camera-motion compensation, depth, contact inference, and uncertainty-aware thresholds.

A Threshold That Graded Its Own Homework

The teleport check compared a track's biggest single-frame jump against a threshold built from that same track's step sizes, which quietly falls apart under sparse tracking. A track with two points, an object seen once and reappearing 1,000 units away a frame later, produced zero violations. The adaptive threshold was derived from that single jump's own magnitude, so it was guaranteed to exceed it no matter how extreme the teleport was.

The fix is leave-one-out: each step's permissiveness comes only from the track's other steps, never from the step being tested. A two-point teleport is now caught, and there's a test pinning exactly that case.

Four of Four Isn't a Rate

Auditing this page, the thing that bothered me was the sample size. Four of four on a curated fixture is an existence proof. So the benchmark now generates ballistic trajectories with tracking noise, keeps half physically valid, and plants one fault in the rest.

Across 400 clips at two noise levels: 100% detection of gravity violations, teleports, and object-permanence gaps, with zero false alarms on 200 clean clips. The false-alarm number is the one I'd watch, because a physics checker that fires on noisy-but-valid motion is a checker people stop reading.

Writing the generator surfaced a labelling trap worth naming. Dropping frames from the end of a track is an object leaving the scene, not a permanence violation. Scoring it as one made the detector look about 30% worse than it is, and the mistake was in my test harness rather than the tool. The generator only plants interior gaps now. 11 tests pass across Python 3.10 through 3.13.

Research Basis

Recent benchmarks treat physical commonsense and temporal consistency as distinct requirements for modern video generation systems. Read PhyCoBench.

Try It

git clone https://github.com/ahmeddoghri/physicsvideo && cd physicsvideo
pip install -e .
physicsvideo demo               # five scenarios, four planted faults
python -m physicsvideo.sweep    # 400 randomized clips: detection and false-alarm rates
physicsvideo serve              # workbench on :8090

Tools Used

Python
OpenCV
Video Generation
Physical Consistency
Robust Thresholding
MP4
Docker