Skip to content

contact_sheet and sample_frames: look at a time window of a long recording #399

Backlog

Description

@TMHSDigital

Summary

Add optional start and end (seconds, validated against the probed duration like trim) to contact_sheet and to sample_frames fps/scenes modes; pass them as input -ss/-t to the ffmpeg calls and add start back to reported tile/frame timestamps so they stay on the source clock.

Where

  • src/tools/contactSheet.ts:26-57
  • src/tools/sampleFrames.ts:34-67
  • src/tools/exportGif.ts:32-33
  • src/tools/readEvents.ts:26-27

Problem

contact_sheet takes input, count (max MAX_SHEET_COUNT), mode even|scenes, sceneThreshold, columns, tileWidth, poster, output and nothing that bounds time; sample_frames modes fps and scenes also run over the whole file (only timestamps can aim). Other tools already take a window: export_gif start/duration (exportGif.ts:32-33), read_events from/to (readEvents.ts:26-27). The server instructions call contact_sheet "the cheapest overview" and search_recording the way to find moments in a long recording, but the two do not compose: after search_recording returns a hit at 41:20, there is no way to get a sheet or scene frames for 40:00-43:00.

Who benefits

On a 1 h recording a 16-tile even sheet puts a tile every ~3.75 min, so the moment the agent found is usually not on it; scenes mode spends its budget on the strongest changes across the whole hour. Agents fall back to many timestamp guesses or trim first (an extra re-encode) just to look.

Proposal

Add optional start and end (seconds, validated against the probed duration like trim) to contact_sheet and to sample_frames fps/scenes modes; pass them as input -ss/-t to the ffmpeg calls and add start back to reported tile/frame timestamps so they stay on the source clock. Mention in the search_recording description that its hit times feed these fields.

Getting started

  • Relevant files: src/tools/contactSheet.ts, src/tools/sampleFrames.ts, src/tools/exportGif.ts, src/tools/readEvents.ts
  • Run tests: npm test (also npm run typecheck and npm run lint); see CONTRIBUTING.md
  • If you change a tool's schema or description, run npm run docs

Filed by repo-audit/full-audit at f0e5ebd. Severity: medium. Effort: S. audit-key: enhancement|src/tools/contactSheet.ts|inputSchema.start

Activity

  1. added
    enhancement
    effort: small
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: smallenhancementpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions