Measure how far the sound is out of sync with the picture
0:20CC-BY-4.0 · WhirlieWheeter (Wikimedia Commons user)
Proof frames
Tool calls
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 3.2,
"label": "flash 1"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-cooking/clip.mp4",
"tolerance_ms": 80,
"cue_recovery_window_ms": 500,
"search_window_ms": 500,
"bpm": null,
"beats_per_bar": null,
"cue_signatures": {},
"systematic_lags": [],
"cuts": [
{
"time_sec": 3.2,
"score": 0.858316,
"nearest_onset": {
"time_sec": 3.029333,
"strength": 1
},
"offset_ms": -170.667
},
{
"time_sec": 6.333333,
"score": 0.891705,
"nearest_onset": {
"time_sec": 6.16,
"strength": 1
},
"offset_ms": -173.333
},
{
"time_sec": 9.466667,
"score": 0.832442,
"nearest_onset": {
"time_sec": 9.296,
"strength": 1
},
"offset_ms": -170.667
}
],
"cues": [
{
"time_sec": 3.2,
"label": "flash 1",
"status": "early",
"matched_onset_time_sec": 3.029333,
"offset_ms": -170.667,
"nearest_onset_time_sec": 3.029333,
"nearest_onset_offset_ms": -170.667,
"cue_group": "flash",
"dominant_band": "44.2-55.7 Hz",
"simple_check_on_time": false,
"simple_check_onset_offset_ms": null,
"simple_check_level_db": -120,
"simple_check_reference_db": -120,
"simple_check_reference": "preceding_90ms",
"group_typical_level_db": null,
"template_status": "early",
"evidence": "template_and_simple_agree",
"audible_in_any_band": false,
"signature_bands": [],
"signature_sample_count": 0,
"signature_score": 1,
"group_median_score": null,
"group_typical_attack_lag_ms": null,
"on_cue_score": null,
"companion_gain": null,
"displaced_time_sec": null,
"shifted_null_floor": null,
"credible_score_floor": null,
"slot_before_ms": null,
"slot_after_ms": null,
"signature_excess_ratio": null,
"search_window_ms": 500,
"match_method": "broad_onset",
"ambiguous_reason": null,
"candidate_onsets": [
{
"time_sec": 3.029333,
"offset_ms": -170.667,
"strength": 1
},
{
"time_sec": 3.541333,
"offset_ms": 341.333,
"strength": 1
},
{
"time_sec": 3.605333,
"offset_ms": 405.333,
"strength": 0.16089
},
{
"time_sec": 3.653333,
"offset_ms": 453.333,
"strength": 0.163422
},
{
"time_sec": 3.690667,
"offset_ms": 490.667,
"strength": 0.147814
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 3.541333,
"strength": 1,
"band_db": {
"sub": -66.225,
"low_mid": -70.877,
"mid": -44.386,
"high": -43.692,
"air": -37.645
}
},
{
"time_sec": 6.16,
"strength": 1,
"band_db": {
"sub": -42.373,
"low_mid": -34.626,
"mid": -6.476,
"high": -34.771,
"air": -39.426
}
},
{
"time_sec": 6.677333,
"strength": 1,
"band_db": {
"sub": -58.022,
"low_mid": -70.994,
"mid": -42.276,
"high": -41.222,
"air": -35.835
}
},
{
"time_sec": 9.296,
"strength": 1,
"band_db": {
"sub": -43.16,
"low_mid": -35.326,
"mid": -7.999,
"high": -35.499,
"air": -40.166
}
},
{
"time_sec": 9.813333,
"strength": 1,
"band_db": {
"sub": -58.624,
"low_mid": -66.774,
"mid": -43.143,
"high": -37.389,
"air": -33.476
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 3,
"total_cues": 1
}
}
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 6.333333,
"label": "flash 2"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-cooking/clip.mp4",
"tolerance_ms": 80,
"cue_recovery_window_ms": 500,
"search_window_ms": 500,
"bpm": null,
"beats_per_bar": null,
"cue_signatures": {},
"systematic_lags": [],
"cuts": [
{
"time_sec": 3.2,
"score": 0.858316,
"nearest_onset": {
"time_sec": 3.029333,
"strength": 1
},
"offset_ms": -170.667
},
{
"time_sec": 6.333333,
"score": 0.891705,
"nearest_onset": {
"time_sec": 6.16,
"strength": 1
},
"offset_ms": -173.333
},
{
"time_sec": 9.466667,
"score": 0.832442,
"nearest_onset": {
"time_sec": 9.296,
"strength": 1
},
"offset_ms": -170.667
}
],
"cues": [
{
"time_sec": 6.333333,
"label": "flash 2",
"status": "early",
"matched_onset_time_sec": 6.16,
"offset_ms": -173.333,
"nearest_onset_time_sec": 6.16,
"nearest_onset_offset_ms": -173.333,
"cue_group": "flash",
"dominant_band": "44.2-55.7 Hz",
"simple_check_on_time": false,
"simple_check_onset_offset_ms": null,
"simple_check_level_db": -120,
"simple_check_reference_db": -120,
"simple_check_reference": "preceding_90ms",
"group_typical_level_db": null,
"template_status": "early",
"evidence": "template_and_simple_agree",
"audible_in_any_band": false,
"signature_bands": [],
"signature_sample_count": 0,
"signature_score": 1,
"group_median_score": null,
"group_typical_attack_lag_ms": null,
"on_cue_score": null,
"companion_gain": null,
"displaced_time_sec": null,
"shifted_null_floor": null,
"credible_score_floor": null,
"slot_before_ms": null,
"slot_after_ms": null,
"signature_excess_ratio": null,
"search_window_ms": 500,
"match_method": "broad_onset",
"ambiguous_reason": null,
"candidate_onsets": [
{
"time_sec": 6.16,
"offset_ms": -173.333,
"strength": 1
},
{
"time_sec": 6.677333,
"offset_ms": 344,
"strength": 1
},
{
"time_sec": 6.778667,
"offset_ms": 445.334,
"strength": 0.165304
},
{
"time_sec": 6.832,
"offset_ms": 498.667,
"strength": 0.160828
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 3.029333,
"strength": 1,
"band_db": {
"sub": -35.913,
"low_mid": -30.063,
"mid": -7.842,
"high": -49.25,
"air": -60.336
}
},
{
"time_sec": 3.541333,
"strength": 1,
"band_db": {
"sub": -66.225,
"low_mid": -70.877,
"mid": -44.386,
"high": -43.692,
"air": -37.645
}
},
{
"time_sec": 6.677333,
"strength": 1,
"band_db": {
"sub": -58.022,
"low_mid": -70.994,
"mid": -42.276,
"high": -41.222,
"air": -35.835
}
},
{
"time_sec": 9.296,
"strength": 1,
"band_db": {
"sub": -43.16,
"low_mid": -35.326,
"mid": -7.999,
"high": -35.499,
"air": -40.166
}
},
{
"time_sec": 9.813333,
"strength": 1,
"band_db": {
"sub": -58.624,
"low_mid": -66.774,
"mid": -43.143,
"high": -37.389,
"air": -33.476
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 3,
"total_cues": 1
}
}
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 9.466667,
"label": "flash 3"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-cooking/clip.mp4",
"tolerance_ms": 80,
"cue_recovery_window_ms": 500,
"search_window_ms": 500,
"bpm": null,
"beats_per_bar": null,
"cue_signatures": {},
"systematic_lags": [],
"cuts": [
{
"time_sec": 3.2,
"score": 0.858316,
"nearest_onset": {
"time_sec": 3.029333,
"strength": 1
},
"offset_ms": -170.667
},
{
"time_sec": 6.333333,
"score": 0.891705,
"nearest_onset": {
"time_sec": 6.16,
"strength": 1
},
"offset_ms": -173.333
},
{
"time_sec": 9.466667,
"score": 0.832442,
"nearest_onset": {
"time_sec": 9.296,
"strength": 1
},
"offset_ms": -170.667
}
],
"cues": [
{
"time_sec": 9.466667,
"label": "flash 3",
"status": "early",
"matched_onset_time_sec": 9.296,
"offset_ms": -170.667,
"nearest_onset_time_sec": 9.296,
"nearest_onset_offset_ms": -170.667,
"cue_group": "flash",
"dominant_band": "44.2-55.7 Hz",
"simple_check_on_time": false,
"simple_check_onset_offset_ms": null,
"simple_check_level_db": -120,
"simple_check_reference_db": -120,
"simple_check_reference": "preceding_90ms",
"group_typical_level_db": null,
"template_status": "early",
"evidence": "template_and_simple_agree",
"audible_in_any_band": false,
"signature_bands": [],
"signature_sample_count": 0,
"signature_score": 1,
"group_median_score": null,
"group_typical_attack_lag_ms": null,
"on_cue_score": null,
"companion_gain": null,
"displaced_time_sec": null,
"shifted_null_floor": null,
"credible_score_floor": null,
"slot_before_ms": null,
"slot_after_ms": null,
"signature_excess_ratio": null,
"search_window_ms": 500,
"match_method": "broad_onset",
"ambiguous_reason": null,
"candidate_onsets": [
{
"time_sec": 9.296,
"offset_ms": -170.667,
"strength": 1
},
{
"time_sec": 9.813333,
"offset_ms": 346.666,
"strength": 1
},
{
"time_sec": 9.888,
"offset_ms": 421.333,
"strength": 0.146589
},
{
"time_sec": 9.936,
"offset_ms": 469.333,
"strength": 0.165851
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 3.029333,
"strength": 1,
"band_db": {
"sub": -35.913,
"low_mid": -30.063,
"mid": -7.842,
"high": -49.25,
"air": -60.336
}
},
{
"time_sec": 3.541333,
"strength": 1,
"band_db": {
"sub": -66.225,
"low_mid": -70.877,
"mid": -44.386,
"high": -43.692,
"air": -37.645
}
},
{
"time_sec": 6.16,
"strength": 1,
"band_db": {
"sub": -42.373,
"low_mid": -34.626,
"mid": -6.476,
"high": -34.771,
"air": -39.426
}
},
{
"time_sec": 6.677333,
"strength": 1,
"band_db": {
"sub": -58.022,
"low_mid": -70.994,
"mid": -42.276,
"high": -41.222,
"air": -35.835
}
},
{
"time_sec": 9.813333,
"strength": 1,
"band_db": {
"sub": -58.624,
"low_mid": -66.774,
"mid": -43.143,
"high": -37.389,
"air": -33.476
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 3,
"total_cues": 1
}
}
frame_at
Arguments
{
"source": "$CLIP",
"time_sec": 3.208333
}
Result
{
"ok": true,
"data": {
"frame_time_sec": 3.2,
"width": 640,
"height": 360,
"source_width": 640,
"source_height": 360,
"crop": null,
"scale": 1,
"file_path": "<cache>/d30247014979a66d1ffb/frame_at/frame_at_853a498b10141290.png",
"tool_file": {
"_tag": "ToolFile",
"name": "frame_at_853a498b10141290.png",
"mimeType": "image/png",
"encoding": "base64",
"data": "<2084 base64 chars dropped>",
"byteLength": 1563
}
}
}
Question and answer
- Question
- Is the sound out of sync in this clip? By how much?
- Answer
- The sync check puts the sound 171 ms early against the picture. That is the median of the three flash cues.
Check passedanswer -170.667, expected -170 ±40
How it was checked
- Truth from
- constructed
- Fixed at
Planted by this recipe before any tool ran: a one-frame white flash and a 30 ms click at the same instant at 3.2, 6.33333, 9.46667 s, with the original sound muted 0.5 s either side of each click; then the whole sound track was moved 170 ms earlier (sound early) with ffmpeg (adelay or atrim), the picture not moved. The truth is that planted shift; the tolerance 40 ms is about one frame at 30 fps.
The script added three white flashes with clicks at known times, then moved the sound by a set amount, so the answer is that set amount, not a fault in the film. Each cue was measured by its own sync_check call.
Try it yourself
Using agentic-video, check whether the sound in my video is out of sync with the picture. Find three moments where a sharp visual flash and a click happen together. Run sync_check once for each of those times, with that one time as the only cue, then tell me the median of the three offsets in milliseconds. Then run frame_at on the first flash so I can see it.
- Get the .mcpb file and open it in Claude Desktop.
- Or:
pip install agentic-video
Clip and licence
- Licence
- CC-BY-4.0
- Author
- WhirlieWheeter (Wikimedia Commons user)
- Source
- commons.wikimedia.org
This file is licensed under the Creative Commons Attribution 4.0 International license.