Count how often a light turns on or off in music footage
0:40CC-BY-4.0 · Predatorsamsung
Proof frames
Tool calls
track_region_events
Arguments
{
"source": "$CLIP",
"start_sec": 0,
"end_sec": 39.88,
"region": {
"x": 0.66625,
"y": 0.0825,
"width": 0.18,
"height": 0.176667
},
"sample_fps": 2
}
Result
{
"ok": true,
"data": {
"region": {
"x": 0.66625,
"y": 0.0825,
"width": 0.18,
"height": 0.176667
},
"start_sec": 0,
"end_sec": 39.88,
"sample_fps": 2,
"sample_count": 80,
"temporal_resolution_sec": 0.5,
"scan_segments": [
{
"start_sec": 0,
"end_sec": 39.88,
"sample_count": 80
}
],
"transitions": [
{
"from_timestamp_sec": 2.5,
"timestamp_sec": 3,
"from_timestamp_provenance": {
"requested_timestamp": 2.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 3,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.236316,
"mean_abs_diff": 0.193716,
"changed_fraction": 0.31543,
"evidence_moments": {
"before": {
"timestamp_sec": 2.5,
"timestamp_provenance": {
"requested_timestamp": 2.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 3,
"timestamp_provenance": {
"requested_timestamp": 3,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 1
},
{
"from_timestamp_sec": 5.5,
"timestamp_sec": 6,
"from_timestamp_provenance": {
"requested_timestamp": 5.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 6,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.236527,
"mean_abs_diff": 0.193909,
"changed_fraction": 0.315674,
"evidence_moments": {
"before": {
"timestamp_sec": 5.5,
"timestamp_provenance": {
"requested_timestamp": 5.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 6,
"timestamp_provenance": {
"requested_timestamp": 6,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 2
},
{
"from_timestamp_sec": 8.5,
"timestamp_sec": 9,
"from_timestamp_provenance": {
"requested_timestamp": 8.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 9,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.236582,
"mean_abs_diff": 0.193994,
"changed_fraction": 0.315674,
"evidence_moments": {
"before": {
"timestamp_sec": 8.5,
"timestamp_provenance": {
"requested_timestamp": 8.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 9,
"timestamp_provenance": {
"requested_timestamp": 9,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 3
},
{
"from_timestamp_sec": 11.5,
"timestamp_sec": 12,
"from_timestamp_provenance": {
"requested_timestamp": 11.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 12,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.236303,
"mean_abs_diff": 0.193565,
"changed_fraction": 0.315674,
"evidence_moments": {
"before": {
"timestamp_sec": 11.5,
"timestamp_provenance": {
"requested_timestamp": 11.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 12,
"timestamp_provenance": {
"requested_timestamp": 12,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 4
},
{
"from_timestamp_sec": 14.5,
"timestamp_sec": 15,
"from_timestamp_provenance": {
"requested_timestamp": 14.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 15,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.236508,
"mean_abs_diff": 0.194012,
"changed_fraction": 0.31543,
"evidence_moments": {
"before": {
"timestamp_sec": 14.5,
"timestamp_provenance": {
"requested_timestamp": 14.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 15,
"timestamp_provenance": {
"requested_timestamp": 15,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 5
},
"…trimmed 3 more"
],
"event_count": 8,
"uncertain": false,
"incomplete": false,
"uncertainty_reason": null
}
}
Question and answer
- Question
- How many times does the light turn on or off in this video?
- Answer
- The tool counts 8 state changes in the box over the clip; each switch on and each switch off is one change.
Check passedanswer 8, expected 8 (tolerance 0)
How it was checked
- Truth from
- constructed
- Fixed at
Planted by this recipe before any tool ran: a dark box (144 by 106 px, left edge at 412 px, top edge at 29 px) was drawn over the picture for the whole 40 s clip, and a yellow light inside it was switched on and off 4 times, at the toggle times 3.25, 6.25, 9.25, 12.25, 15.25, 18.75, 22.25, 25.25 s, with ffmpeg. The truth is 8 state changes (each switch on and each switch off counts once), fixed here before the run. The call samples 2 frames per second over the clip with the box inset by 0.1 of its size on each side.
A script drew a dark box over the picture and switched a light in it on and off 4 times at set times, so the count is those planted changes (each on and each off counts once) and only the box was checked.
Try it yourself
Use agentic-video to count how often the light in my video turns on or off. Run track_region_events on the box at x 0.666, y 0.083, width 0.180, height 0.177 (fractions of the frame) from 0 to 39.88 seconds, sampling 2 frames per second. Tell me the event count, then show me the first change. Use my own file.
- Get the .mcpb file and open it in Claude Desktop.
- Or:
pip install agentic-video
Clip and licence
- Licence
- CC-BY-4.0
- Author
- Predatorsamsung
- Source
- commons.wikimedia.org
This file is licensed under the Creative Commons Attribution 4.0 International license.