Measure how far the sound is out of sync with the picture
0:20CC-BY-2.5 · Orange Open Movie Team (Blender Foundation)
Proof frames
Tool calls
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 3.958333,
"label": "flash 1"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-film/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.958333,
"score": 1,
"nearest_onset": {
"time_sec": 4.16,
"strength": 1
},
"offset_ms": 201.667
},
{
"time_sec": 4.75,
"score": 0.168536,
"nearest_onset": {
"time_sec": 4.746667,
"strength": 0.147614
},
"offset_ms": -3.333
},
{
"time_sec": 7.416667,
"score": 1,
"nearest_onset": {
"time_sec": 7.616,
"strength": 1
},
"offset_ms": 199.333
},
{
"time_sec": 9.791667,
"score": 0.284261,
"nearest_onset": {
"time_sec": 9.786667,
"strength": 0.139652
},
"offset_ms": -5
},
{
"time_sec": 10.875,
"score": 1,
"nearest_onset": {
"time_sec": 11.077333,
"strength": 1
},
"offset_ms": 202.333
},
{
"time_sec": 12.708333,
"score": 0.284116,
"nearest_onset": {
"time_sec": 12.688,
"strength": 0.173795
},
"offset_ms": -20.333
},
{
"time_sec": 17.458333,
"score": 0.316073,
"nearest_onset": {
"time_sec": 17.461333,
"strength": 0.200775
},
"offset_ms": 3
},
{
"time_sec": 19.666667,
"score": 0.338797,
"nearest_onset": {
"time_sec": 19.669333,
"strength": 0.141983
},
"offset_ms": 2.666
}
],
"cues": [
{
"time_sec": 3.958333,
"label": "flash 1",
"status": "late",
"matched_onset_time_sec": 4.16,
"offset_ms": 201.667,
"nearest_onset_time_sec": 4.16,
"nearest_onset_offset_ms": 201.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": "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": 3.493333,
"offset_ms": -465,
"strength": 0.133225
},
{
"time_sec": 3.525333,
"offset_ms": -433,
"strength": 0.131218
},
{
"time_sec": 3.557333,
"offset_ms": -401,
"strength": 0.141179
},
{
"time_sec": 3.589333,
"offset_ms": -369,
"strength": 0.128227
},
{
"time_sec": 3.626667,
"offset_ms": -331.666,
"strength": 0.152826
},
{
"time_sec": 4.16,
"offset_ms": 201.667,
"strength": 1
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 0.202667,
"strength": 1,
"band_db": {
"sub": -46.346,
"low_mid": -25.206,
"mid": -44.931,
"high": -51.498,
"air": -103.776
}
},
{
"time_sec": 4.661333,
"strength": 1,
"band_db": {
"sub": -56.188,
"low_mid": -50.762,
"mid": -46.461,
"high": -58.288,
"air": -120
}
},
{
"time_sec": 7.616,
"strength": 1,
"band_db": {
"sub": -42.139,
"low_mid": -34.625,
"mid": -6.374,
"high": -34.745,
"air": -39.337
}
},
{
"time_sec": 8.138667,
"strength": 1,
"band_db": {
"sub": -44.026,
"low_mid": -38.791,
"mid": -47.418,
"high": -60.499,
"air": -120
}
},
{
"time_sec": 11.077333,
"strength": 1,
"band_db": {
"sub": -35.915,
"low_mid": -30.062,
"mid": -7.842,
"high": -49.25,
"air": -60.328
}
},
{
"time_sec": 11.594667,
"strength": 1,
"band_db": {
"sub": -45.171,
"low_mid": -39.852,
"mid": -45.896,
"high": -59.065,
"air": -120
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 8,
"total_cues": 1
}
}
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 7.416667,
"label": "flash 2"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-film/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.958333,
"score": 1,
"nearest_onset": {
"time_sec": 4.16,
"strength": 1
},
"offset_ms": 201.667
},
{
"time_sec": 4.75,
"score": 0.168536,
"nearest_onset": {
"time_sec": 4.746667,
"strength": 0.147614
},
"offset_ms": -3.333
},
{
"time_sec": 7.416667,
"score": 1,
"nearest_onset": {
"time_sec": 7.616,
"strength": 1
},
"offset_ms": 199.333
},
{
"time_sec": 9.791667,
"score": 0.284261,
"nearest_onset": {
"time_sec": 9.786667,
"strength": 0.139652
},
"offset_ms": -5
},
{
"time_sec": 10.875,
"score": 1,
"nearest_onset": {
"time_sec": 11.077333,
"strength": 1
},
"offset_ms": 202.333
},
{
"time_sec": 12.708333,
"score": 0.284116,
"nearest_onset": {
"time_sec": 12.688,
"strength": 0.173795
},
"offset_ms": -20.333
},
{
"time_sec": 17.458333,
"score": 0.316073,
"nearest_onset": {
"time_sec": 17.461333,
"strength": 0.200775
},
"offset_ms": 3
},
{
"time_sec": 19.666667,
"score": 0.338797,
"nearest_onset": {
"time_sec": 19.669333,
"strength": 0.141983
},
"offset_ms": 2.666
}
],
"cues": [
{
"time_sec": 7.416667,
"label": "flash 2",
"status": "late",
"matched_onset_time_sec": 7.616,
"offset_ms": 199.333,
"nearest_onset_time_sec": 7.616,
"nearest_onset_offset_ms": 199.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": 6.938667,
"offset_ms": -478,
"strength": 0.147137
},
{
"time_sec": 6.970667,
"offset_ms": -446,
"strength": 0.140693
},
{
"time_sec": 7.013333,
"offset_ms": -403.334,
"strength": 0.15105
},
{
"time_sec": 7.056,
"offset_ms": -360.667,
"strength": 0.179126
},
{
"time_sec": 7.104,
"offset_ms": -312.667,
"strength": 0.112597
},
{
"time_sec": 7.616,
"offset_ms": 199.333,
"strength": 1
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 0.202667,
"strength": 1,
"band_db": {
"sub": -46.346,
"low_mid": -25.206,
"mid": -44.931,
"high": -51.498,
"air": -103.776
}
},
{
"time_sec": 4.16,
"strength": 1,
"band_db": {
"sub": -42.378,
"low_mid": -35.212,
"mid": -7.453,
"high": -35.281,
"air": -39.947
}
},
{
"time_sec": 4.661333,
"strength": 1,
"band_db": {
"sub": -56.188,
"low_mid": -50.762,
"mid": -46.461,
"high": -58.288,
"air": -120
}
},
{
"time_sec": 8.138667,
"strength": 1,
"band_db": {
"sub": -44.026,
"low_mid": -38.791,
"mid": -47.418,
"high": -60.499,
"air": -120
}
},
{
"time_sec": 11.077333,
"strength": 1,
"band_db": {
"sub": -35.915,
"low_mid": -30.062,
"mid": -7.842,
"high": -49.25,
"air": -60.328
}
},
{
"time_sec": 11.594667,
"strength": 1,
"band_db": {
"sub": -45.171,
"low_mid": -39.852,
"mid": -45.896,
"high": -59.065,
"air": -120
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 8,
"total_cues": 1
}
}
sync_check
Arguments
{
"source": "$CLIP",
"cues": [
{
"time_sec": 10.875,
"label": "flash 3"
}
]
}
Result
{
"ok": true,
"data": {
"source_path": "~/hill/gallery/repo/cards/sync-film/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.958333,
"score": 1,
"nearest_onset": {
"time_sec": 4.16,
"strength": 1
},
"offset_ms": 201.667
},
{
"time_sec": 4.75,
"score": 0.168536,
"nearest_onset": {
"time_sec": 4.746667,
"strength": 0.147614
},
"offset_ms": -3.333
},
{
"time_sec": 7.416667,
"score": 1,
"nearest_onset": {
"time_sec": 7.616,
"strength": 1
},
"offset_ms": 199.333
},
{
"time_sec": 9.791667,
"score": 0.284261,
"nearest_onset": {
"time_sec": 9.786667,
"strength": 0.139652
},
"offset_ms": -5
},
{
"time_sec": 10.875,
"score": 1,
"nearest_onset": {
"time_sec": 11.077333,
"strength": 1
},
"offset_ms": 202.333
},
{
"time_sec": 12.708333,
"score": 0.284116,
"nearest_onset": {
"time_sec": 12.688,
"strength": 0.173795
},
"offset_ms": -20.333
},
{
"time_sec": 17.458333,
"score": 0.316073,
"nearest_onset": {
"time_sec": 17.461333,
"strength": 0.200775
},
"offset_ms": 3
},
{
"time_sec": 19.666667,
"score": 0.338797,
"nearest_onset": {
"time_sec": 19.669333,
"strength": 0.141983
},
"offset_ms": 2.666
}
],
"cues": [
{
"time_sec": 10.875,
"label": "flash 3",
"status": "late",
"matched_onset_time_sec": 11.077333,
"offset_ms": 202.333,
"nearest_onset_time_sec": 11.077333,
"nearest_onset_offset_ms": 202.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": 10.426667,
"offset_ms": -448.333,
"strength": 0.150388
},
{
"time_sec": 10.506667,
"offset_ms": -368.333,
"strength": 0.143364
},
{
"time_sec": 10.570667,
"offset_ms": -304.333,
"strength": 0.214098
},
{
"time_sec": 11.077333,
"offset_ms": 202.333,
"strength": 1
}
]
}
],
"unmatched_strong_onsets": [
{
"time_sec": 0.202667,
"strength": 1,
"band_db": {
"sub": -46.346,
"low_mid": -25.206,
"mid": -44.931,
"high": -51.498,
"air": -103.776
}
},
{
"time_sec": 4.16,
"strength": 1,
"band_db": {
"sub": -42.378,
"low_mid": -35.212,
"mid": -7.453,
"high": -35.281,
"air": -39.947
}
},
{
"time_sec": 4.661333,
"strength": 1,
"band_db": {
"sub": -56.188,
"low_mid": -50.762,
"mid": -46.461,
"high": -58.288,
"air": -120
}
},
{
"time_sec": 7.616,
"strength": 1,
"band_db": {
"sub": -42.139,
"low_mid": -34.625,
"mid": -6.374,
"high": -34.745,
"air": -39.337
}
},
{
"time_sec": 8.138667,
"strength": 1,
"band_db": {
"sub": -44.026,
"low_mid": -38.791,
"mid": -47.418,
"high": -60.499,
"air": -120
}
},
{
"time_sec": 11.594667,
"strength": 1,
"band_db": {
"sub": -45.171,
"low_mid": -39.852,
"mid": -45.896,
"high": -59.065,
"air": -120
}
}
],
"uncued_sounds": [],
"strong_onset_threshold": 0.5,
"total_cuts": 8,
"total_cues": 1
}
}
frame_at
Arguments
{
"source": "$CLIP",
"time_sec": 3.96875
}
Result
{
"ok": true,
"data": {
"frame_time_sec": 3.958333,
"width": 640,
"height": 360,
"source_width": 640,
"source_height": 360,
"crop": null,
"scale": 1,
"file_path": "<cache>/cb67048779ae29b8bf6c/frame_at/frame_at_604e9dde77a27c7f.png",
"tool_file": {
"_tag": "ToolFile",
"name": "frame_at_604e9dde77a27c7f.png",
"mimeType": "image/png",
"encoding": "base64",
"data": "<2004 base64 chars dropped>",
"byteLength": 1503
}
}
}
Question and answer
- Question
- Is the sound out of sync in this clip? By how much?
- Answer
- The sync check puts the sound 202 ms late against the picture. That is the median of the three flash cues.
Check passedanswer 201.667, expected 203 ±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.95833, 7.41667, 10.875 s, with the original sound muted 0.5 s either side of each click; then the whole sound track was moved 203 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 24 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-2.5
- Author
- Orange Open Movie Team (Blender Foundation)
- Source
- commons.wikimedia.org
This file is licensed under the Creative Commons Attribution 2.5 Generic license.