Measure how far the sound is out of sync with the picture
0:20CC-BY-SA-4.0 · Addshore
Proof frames
Tool calls
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 3.3,
"label": "flash 1"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-nature/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.3,
"score": 1,
"nearest_onset": {
"time_sec": 3.066667,
"strength": 0.170994
},
"offset_ms": -233.333
},
{
"time_sec": 6.766667,
"score": 1,
"nearest_onset": {
"time_sec": 6.549333,
"strength": 0.155165
},
"offset_ms": -217.334
},
{
"time_sec": 10.233333,
"score": 1,
"nearest_onset": {
"time_sec": 10.506667,
"strength": 1
},
"offset_ms": 273.334
},
{
"time_sec": 18,
"score": 0.033367,
"nearest_onset": {
"time_sec": 17.984,
"strength": 0.162994
},
"offset_ms": -16
}
],
"cues": [
{
"time_sec": 3.3,
"label": "flash 1",
"status": "late",
"matched_onset_time_sec": 3.573333,
"offset_ms": 273.333,
"nearest_onset_time_sec": 3.066667,
"nearest_onset_offset_ms": -233.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": "late",
"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": 2.826667,
"offset_ms": -473.333,
"strength": 0.149285
},
{
"time_sec": 2.869333,
"offset_ms": -430.667,
"strength": 0.148171
},
{
"time_sec": 2.906667,
"offset_ms": -393.333,
"strength": 0.139175
},
{
"time_sec": 2.954667,
"offset_ms": -345.333,
"strength": 0.189926
},
{
"time_sec": 2.986667,
"offset_ms": -313.333,
"strength": 0.176126
},
{
"time_sec": 3.034667,
"offset_ms": -265.333,
"strength": 0.161755
},
{
"time_sec": 3.066667,
"offset_ms": -233.333,
"strength": 0.170994
},
{
"time_sec": 3.573333,
"offset_ms": 273.333,
"strength": 1
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 0.282667,
"strength": 1,
"band_db": {
"sub": -70.749,
"low_mid": -73.16,
"mid": -82.503,
"high": -101.903,
"air": -103.541
}
},
{
"time_sec": 4.074667,
"strength": 1,
"band_db": {
"sub": -50.111,
"low_mid": -53.916,
"mid": -60.038,
"high": -80.422,
"air": -86.169
}
},
{
"time_sec": 7.04,
"strength": 1,
"band_db": {
"sub": -42.139,
"low_mid": -34.625,
"mid": -6.374,
"high": -34.745,
"air": -39.328
}
},
{
"time_sec": 7.552,
"strength": 1,
"band_db": {
"sub": -48.053,
"low_mid": -52.427,
"mid": -59.951,
"high": -78.411,
"air": -85.746
}
},
{
"time_sec": 10.506667,
"strength": 1,
"band_db": {
"sub": -41.996,
"low_mid": -34.542,
"mid": -6.329,
"high": -34.696,
"air": -39.351
}
},
{
"time_sec": 11.008,
"strength": 1,
"band_db": {
"sub": -46.469,
"low_mid": -52.608,
"mid": -57.612,
"high": -78.315,
"air": -83.905
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 4,
"total_cues": 1
}
}
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 6.766667,
"label": "flash 2"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-nature/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.3,
"score": 1,
"nearest_onset": {
"time_sec": 3.066667,
"strength": 0.170994
},
"offset_ms": -233.333
},
{
"time_sec": 6.766667,
"score": 1,
"nearest_onset": {
"time_sec": 6.549333,
"strength": 0.155165
},
"offset_ms": -217.334
},
{
"time_sec": 10.233333,
"score": 1,
"nearest_onset": {
"time_sec": 10.506667,
"strength": 1
},
"offset_ms": 273.334
},
{
"time_sec": 18,
"score": 0.033367,
"nearest_onset": {
"time_sec": 17.984,
"strength": 0.162994
},
"offset_ms": -16
}
],
"cues": [
{
"time_sec": 6.766667,
"label": "flash 2",
"status": "late",
"matched_onset_time_sec": 7.04,
"offset_ms": 273.333,
"nearest_onset_time_sec": 6.549333,
"nearest_onset_offset_ms": -217.334,
"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": "late",
"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.309333,
"offset_ms": -457.334,
"strength": 0.170503
},
{
"time_sec": 6.341333,
"offset_ms": -425.334,
"strength": 0.162685
},
{
"time_sec": 6.389333,
"offset_ms": -377.334,
"strength": 0.162757
},
{
"time_sec": 6.432,
"offset_ms": -334.667,
"strength": 0.14164
},
{
"time_sec": 6.469333,
"offset_ms": -297.334,
"strength": 0.168547
},
{
"time_sec": 6.501333,
"offset_ms": -265.334,
"strength": 0.17433
},
{
"time_sec": 6.549333,
"offset_ms": -217.334,
"strength": 0.155165
},
{
"time_sec": 7.04,
"offset_ms": 273.333,
"strength": 1
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 0.282667,
"strength": 1,
"band_db": {
"sub": -70.749,
"low_mid": -73.16,
"mid": -82.503,
"high": -101.903,
"air": -103.541
}
},
{
"time_sec": 3.573333,
"strength": 1,
"band_db": {
"sub": -35.165,
"low_mid": -29.238,
"mid": -6.362,
"high": -48.461,
"air": -59.545
}
},
{
"time_sec": 4.074667,
"strength": 1,
"band_db": {
"sub": -50.111,
"low_mid": -53.916,
"mid": -60.038,
"high": -80.422,
"air": -86.169
}
},
{
"time_sec": 7.552,
"strength": 1,
"band_db": {
"sub": -48.053,
"low_mid": -52.427,
"mid": -59.951,
"high": -78.411,
"air": -85.746
}
},
{
"time_sec": 10.506667,
"strength": 1,
"band_db": {
"sub": -41.996,
"low_mid": -34.542,
"mid": -6.329,
"high": -34.696,
"air": -39.351
}
},
{
"time_sec": 11.008,
"strength": 1,
"band_db": {
"sub": -46.469,
"low_mid": -52.608,
"mid": -57.612,
"high": -78.315,
"air": -83.905
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 4,
"total_cues": 1
}
}
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 10.233333,
"label": "flash 3"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-nature/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.3,
"score": 1,
"nearest_onset": {
"time_sec": 3.066667,
"strength": 0.170994
},
"offset_ms": -233.333
},
{
"time_sec": 6.766667,
"score": 1,
"nearest_onset": {
"time_sec": 6.549333,
"strength": 0.155165
},
"offset_ms": -217.334
},
{
"time_sec": 10.233333,
"score": 1,
"nearest_onset": {
"time_sec": 10.506667,
"strength": 1
},
"offset_ms": 273.334
},
{
"time_sec": 18,
"score": 0.033367,
"nearest_onset": {
"time_sec": 17.984,
"strength": 0.162994
},
"offset_ms": -16
}
],
"cues": [
{
"time_sec": 10.233333,
"label": "flash 3",
"status": "late",
"matched_onset_time_sec": 10.506667,
"offset_ms": 273.334,
"nearest_onset_time_sec": 10.506667,
"nearest_onset_offset_ms": 273.334,
"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": "late",
"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.749333,
"offset_ms": -484,
"strength": 0.147728
},
{
"time_sec": 9.781333,
"offset_ms": -452,
"strength": 0.162427
},
{
"time_sec": 9.829333,
"offset_ms": -404,
"strength": 0.160168
},
{
"time_sec": 9.866667,
"offset_ms": -366.666,
"strength": 0.142353
},
{
"time_sec": 9.904,
"offset_ms": -329.333,
"strength": 0.128323
},
{
"time_sec": 9.946667,
"offset_ms": -286.666,
"strength": 0.156934
},
{
"time_sec": 10.506667,
"offset_ms": 273.334,
"strength": 1
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 0.282667,
"strength": 1,
"band_db": {
"sub": -70.749,
"low_mid": -73.16,
"mid": -82.503,
"high": -101.903,
"air": -103.541
}
},
{
"time_sec": 3.573333,
"strength": 1,
"band_db": {
"sub": -35.165,
"low_mid": -29.238,
"mid": -6.362,
"high": -48.461,
"air": -59.545
}
},
{
"time_sec": 4.074667,
"strength": 1,
"band_db": {
"sub": -50.111,
"low_mid": -53.916,
"mid": -60.038,
"high": -80.422,
"air": -86.169
}
},
{
"time_sec": 7.04,
"strength": 1,
"band_db": {
"sub": -42.139,
"low_mid": -34.625,
"mid": -6.374,
"high": -34.745,
"air": -39.328
}
},
{
"time_sec": 7.552,
"strength": 1,
"band_db": {
"sub": -48.053,
"low_mid": -52.427,
"mid": -59.951,
"high": -78.411,
"air": -85.746
}
},
{
"time_sec": 11.008,
"strength": 1,
"band_db": {
"sub": -46.469,
"low_mid": -52.608,
"mid": -57.612,
"high": -78.315,
"air": -83.905
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 4,
"total_cues": 1
}
}
frame_at
Arguments
{
"source": "$CLIP",
"time_sec": 3.308333
}
Result
{
"ok": true,
"data": {
"frame_time_sec": 3.3,
"width": 640,
"height": 360,
"source_width": 640,
"source_height": 360,
"crop": null,
"scale": 1,
"file_path": "<cache>/f56df0919ac00d3660f6/frame_at/frame_at_8808c68e8e0f4224.png",
"tool_file": {
"_tag": "ToolFile",
"name": "frame_at_8808c68e8e0f4224.png",
"mimeType": "image/png",
"encoding": "base64",
"data": "<2108 base64 chars dropped>",
"byteLength": 1579
}
}
}
Question and answer
- Question
- Is the sound out of sync in this clip? By how much?
- Answer
- The sync check puts the sound 273 ms late against the picture. That is the median of the three flash cues.
Check passedanswer 273.333, expected 277 ±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.3, 6.76667, 10.2333 s, with the original sound muted 0.5 s either side of each click; then the whole sound track was moved 277 ms later (sound late) 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-SA-4.0
- Author
- Addshore
- Source
- commons.wikimedia.org
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.