Count how often a light turns on or off in cooking footage
0:40CC-BY-SA-4.0 · مصطفى ملو (Wikimedia Commons user)
Proof frames
Tool calls
track_region_events
Arguments
{
"source": "$CLIP",
"start_sec": 0,
"end_sec": 39.9,
"region": {
"x": 0.674063,
"y": 0.083056,
"width": 0.18,
"height": 0.175556
},
"sample_fps": 2
}
Result
{
"ok": true,
"data": {
"region": {
"x": 0.674063,
"y": 0.083056,
"width": 0.18,
"height": 0.175556
},
"start_sec": 0,
"end_sec": 39.9,
"sample_fps": 2,
"sample_count": 80,
"temporal_resolution_sec": 0.5,
"scan_segments": [
{
"start_sec": 0,
"end_sec": 39.9,
"sample_count": 80
}
],
"transitions": [
{
"from_timestamp_sec": 3,
"timestamp_sec": 3.5,
"from_timestamp_provenance": {
"requested_timestamp": 3,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 3.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.177002,
"mean_abs_diff": 0.143349,
"changed_fraction": 0.239502,
"evidence_moments": {
"before": {
"timestamp_sec": 3,
"timestamp_provenance": {
"requested_timestamp": 3,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 3.5,
"timestamp_provenance": {
"requested_timestamp": 3.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 1
},
{
"from_timestamp_sec": 6.5,
"timestamp_sec": 7,
"from_timestamp_provenance": {
"requested_timestamp": 6.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 7,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.177619,
"mean_abs_diff": 0.144297,
"changed_fraction": 0.239502,
"evidence_moments": {
"before": {
"timestamp_sec": 6.5,
"timestamp_provenance": {
"requested_timestamp": 6.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 7,
"timestamp_provenance": {
"requested_timestamp": 7,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 2
},
{
"from_timestamp_sec": 10,
"timestamp_sec": 10.5,
"from_timestamp_provenance": {
"requested_timestamp": 10,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 10.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.177718,
"mean_abs_diff": 0.144055,
"changed_fraction": 0.240234,
"evidence_moments": {
"before": {
"timestamp_sec": 10,
"timestamp_provenance": {
"requested_timestamp": 10,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 10.5,
"timestamp_provenance": {
"requested_timestamp": 10.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 3
},
{
"from_timestamp_sec": 13.5,
"timestamp_sec": 14,
"from_timestamp_provenance": {
"requested_timestamp": 13.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 14,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.177859,
"mean_abs_diff": 0.144403,
"changed_fraction": 0.23999,
"evidence_moments": {
"before": {
"timestamp_sec": 13.5,
"timestamp_provenance": {
"requested_timestamp": 13.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 14,
"timestamp_provenance": {
"requested_timestamp": 14,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 4
}
],
"event_count": 4,
"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 4 state changes in the box over the clip; each switch on and each switch off is one change.
Check passedanswer 4, expected 4 (tolerance 0)
How it was checked
- Truth from
- constructed
- Fixed at
Planted by this recipe before any tool ran: a dark box (144 by 79 px, left edge at 417 px, top edge at 22 px) was drawn over the picture for the whole 40 s clip, and a yellow light inside it was switched on and off 2 times, at the toggle times 3.25, 6.75, 10.25, 13.75 s, with ffmpeg. The truth is 4 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 2 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.674, y 0.083, width 0.180, height 0.176 (fractions of the frame) from 0 to 39.9 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-SA-4.0
- Author
- مصطفى ملو (Wikimedia Commons user)
- Source
- commons.wikimedia.org
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.