Skip to content

Estimate unmatched clips from same-device timestamps - #32

Closed
REVPKD wants to merge 4 commits into
FedyaLight:mainfrom
REVPKD:timestamp-anchor-placement
Closed

REVPKD wants to merge 4 commits into
FedyaLight:mainfrom
REVPKD:timestamp-anchor-placement

Conversation

@REVPKD

@REVPKD REVPKD commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Use embedded recording-time differences from waveform-matched clips on the same device to estimate positions for clips that remain unmatched. Keep estimates explicitly unconfirmed in results, timeline previews, and exports without changing waveform matches.

What changes for the user

  • An unmatched clip can be placed relative to a waveform-matched clip from the same recording device, including when it falls inside that device's existing timeline span.
  • Recording clocks are never compared across devices, and timestamp estimates never move waveform-matched clips.
  • Estimated placements remain visibly unconfirmed in the result and in exported timelines.
  • Includes regression coverage for a matched camera clip anchoring a later unmatched clip from that camera.

How I checked it

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo doc --workspace --no-deps
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps
  • cargo test --workspace - passed (one existing network test ignored)
  • AAF Python unit tests - 13 passed
  • cargo build --release -p align-cli
  • Windows end-to-end acceptance - all 8 gates passed

The Windows acceptance run also exposed an overlong generated audio-sidecar name. This branch includes the small path-length fix and regression test so the required Windows acceptance check passes.

Use embedded recording-time differences from waveform-matched clips on the same device to estimate positions for clips that remain unmatched. Keep estimates explicitly unconfirmed in results, timeline previews, and exports without changing waveform matches.

@FedyaLight FedyaLight left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. Estimating placement from the same recording device is a useful fallback for clips that remain unmatched. I reproduced the following with 033c3ad on the earlier main baseline d2a4a06.

  • When the FileSpans stage moves the camera anchor from 2 s to 102 s, a clip recorded 10 s later is placed at 12 s. Its position on that stage should be 112 s.
  • If the anchor is missing from the selected stage, the estimated clip can disappear from the export even with unmatched clips included.
  • In a 25 fps Premiere XML export, the replacement audio gets <in>375</in>. The expected source in-point is frame 125.

Please resolve the timestamp delta relative to the anchor on the selected stage, leave the clip in the unmatched list when the estimate cannot be applied, and keep the source-to-timeline mapping in sync with the estimated position. Please also bound large timestamp gaps and make applying estimated placements to exports an explicit option.

Regression coverage for stage switching, missing anchors, and the source range in the final Premiere XML would help. Please run the workspace checks on current main as part of the update.

Apply relative recording-time deltas from waveform-matched clips on the selected export stage. Keep unmatched clips visible when an anchor cannot be applied, preserve source-to-timeline mapping, bound large gaps, and require explicit opt-in before estimated placements enter exports.
FedyaLight added a commit that referenced this pull request Nov 24, 2026
An unmatched Sony clip whose camera recorded its serial number and start
time can now be placed between the nearest clips of the same camera that
sound synchronized in one group, interpolating their clock offsets. The
estimate is recomputed from the active stage and time-source policy, never
stored in results, and applied only on request: per clip in the desktop
app, kept per sequence in the project, or with --camera-clock and
--camera-clock-except in the CLI. Clips are refused, with the reason, for
Timecode time sources, file dates, missing or conflicting anchors, another
group, a gap they do not fit, overlaps, and rejected alignments.

Applied estimates keep every other clip's position and track in every
writer: the clip's unmatched place stays reserved, and track allocation
packs it there before moving it alone. Placed clips are named
[CAMERA CLOCK], stay unmatched for labels and Remove, keep their own sound
in the Premiere replaced sequence, and get no clean-audio media file.
Imported edits keep their placement and get a diagnostic comparison with
the clock instead.

Inspired by #32 from @REVPKD.

Co-authored-by: REVPKD <felix@reversingpkd.com>
FedyaLight added a commit that referenced this pull request Nov 24, 2026
Reject ambiguous camera dates and conflicting choices, and use the active assembly options for review and export. Keep the original sequence settings, track order and reserved end while giving moved events compatible tracks, multicam angles and linked AAF names.

Extend the generated shoot through synchronization, import and independent artifact readback. This follows the camera-clock placement inspired by #32 from @REVPKD.
@FedyaLight

Copy link
Copy Markdown
Owner

Landed as an independent implementation in 5bbfc6c, with the follow-up fixes on main through 77a71b4.

Thanks, @REVPKD, for proposing and prototyping placement by camera clock.

@FedyaLight FedyaLight closed this Nov 24, 2026
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.

2 participants