Skip to content

Fix VMAF cadence origin alignment - #47

Merged
Jellman86 merged 1 commit into
devfrom
fix/vmaf-cadence-origin
Jul 29, 2026
Merged

Fix VMAF cadence origin alignment#47
Jellman86 merged 1 commit into
devfrom
fix/vmaf-cadence-origin

Conversation

@Jellman86

Copy link
Copy Markdown
Owner

What changed

  • rebase each decoded VMAF input to its own first picture before fps(start_time=0) cadence normalisation
  • keep the existing common-cadence and bounded-window trimming after that origin reset
  • add a regression test covering an MP4 candidate against a Matroska reference
  • document the shared Preview, Personal quality, adaptive, and normal verification behaviour

Why

Riker live validation exposed a false VMAF result after the clipped-timeline fix: QSV H.264/HEVC samples were correctly cut and had SSIM ≈0.998 against the requested source scene, but VMAF reported ≈32. The same software AV1 scene reported ≈98.8.

FFmpeg documents that fps(start_time=0) may pad or trim based on the input's existing first PTS. Applying it before PTS-STARTPTS allowed MP4 and Matroska inputs with different timestamp origins to select adjacent pictures. Rebasing first makes cadence rounding deterministic.

Official references:

Evidence

Using the exact completed Riker calibration sample without re-encoding:

Path Before After origin-first cadence
QSV H.264 VMAF mean 31.96 VMAF mean 99.36
QSV HEVC VMAF mean 31.87 VMAF mean 99.54
software AV1 VMAF mean 98.77 VMAF mean 98.77

This isolates the correction to the scorer: the encoded files are unchanged.

Verification

  • dotnet build Optimisarr.slnx --no-restore -warnaserror — 0 warnings, 0 errors
  • dotnet test Optimisarr.slnx --no-build --no-restore — 1,487 passed
  • npm --prefix web run check — clean, including locale/setup checks
  • python3 scripts/check_docs.py — links and OpenAPI references valid
  • git diff --check — clean

Safety

No database, replacement, retry, exclusion, quality-threshold, or encoder changes. This corrects the shared VMAF measurement timeline only.

@Jellman86
Jellman86 marked this pull request as ready for review July 29, 2026 08:45
@Jellman86
Jellman86 merged commit 6ac6e71 into dev Jul 29, 2026
8 checks passed

Copy link
Copy Markdown
Owner Author

Post-merge live verification is complete on Riker using the published dev image from 6ac6e71 (ghcr.io/jellman86/optimisarr@sha256:621d7385197a27a95728d4e84bc6957fd36c6fb5df8b0e86b2ed24b02cabe184).

A fresh Personal quality session prepared all 12 clips and reached Comparing with monotonic progress and no calibration failures. Reveal measured all three scenes for every preset:

  • QSV H.264: mean/harmonic 99.36, minimum 96.72
  • QSV HEVC: mean/harmonic 99.53, minimum 97.14
  • software AV1: mean 98.80, harmonic 98.79, minimum 96.63

Every output was 12.000–12.039 seconds and the greatest video/audio start separation was 40 ms. The browser media endpoints returned distinct files with preset-specific codecs, containers, sizes, and modification times. The temporary library, session, preview records, synthetic media, and scratch artifacts were then removed; Optimisarr remains healthy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant