Count how often a light turns on or off in game footage
0:40CC-BY-SA-4.0 · PantheraLeo1359531
Proof frames
Tool calls
track_region_events
Arguments
{
"source": "$CLIP",
"start_sec": 0,
"end_sec": 39.9,
"region": {
"x": 0.638437,
"y": 0.083056,
"width": 0.195,
"height": 0.175556
},
"sample_fps": 2
}
Result
{
"ok": true,
"data": {
"region": {
"x": 0.638437,
"y": 0.083056,
"width": 0.195,
"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": 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.166106,
"mean_abs_diff": 0.134735,
"changed_fraction": 0.224365,
"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.165795,
"mean_abs_diff": 0.134389,
"changed_fraction": 0.224121,
"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": 9,
"timestamp_sec": 9.5,
"from_timestamp_provenance": {
"requested_timestamp": 9,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 9.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.165746,
"mean_abs_diff": 0.134313,
"changed_fraction": 0.224121,
"evidence_moments": {
"before": {
"timestamp_sec": 9,
"timestamp_provenance": {
"requested_timestamp": 9,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 9.5,
"timestamp_provenance": {
"requested_timestamp": 9.5,
"decoded_timestamp": null,
"timestamp_delta": null
}
}
},
"rank": 3
},
{
"from_timestamp_sec": 12,
"timestamp_sec": 12.5,
"from_timestamp_provenance": {
"requested_timestamp": 12,
"decoded_timestamp": null,
"timestamp_delta": null
},
"timestamp_provenance": {
"requested_timestamp": 12.5,
"decoded_timestamp": null,
"timestamp_delta": null
},
"change_score": 0.165759,
"mean_abs_diff": 0.134334,
"changed_fraction": 0.224121,
"evidence_moments": {
"before": {
"timestamp_sec": 12,
"timestamp_provenance": {
"requested_timestamp": 12,
"decoded_timestamp": null,
"timestamp_delta": null
}
},
"after": {
"timestamp_sec": 12.5,
"timestamp_provenance": {
"requested_timestamp": 12.5,
"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 (156 by 79 px, left edge at 393 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 2.75, 5.75, 9.25, 12.25 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.638, y 0.083, width 0.195, 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
- PantheraLeo1359531
- Source
- commons.wikimedia.org
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International, 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic license.