Skip to main content
Glama

Find the sync offset between two recordings

find_audio_sync_offset_between_files
Read-onlyIdempotent

Measure the time offset between two recordings of the same event by comparing their audio loudness envelopes, returning the seconds needed to align one clip to the reference.

Instructions

Find how far apart two recordings of the same event are in time by comparing their audio (cross-correlation of the loudness envelopes): camera sound against an external recorder, or two cameras. Returns offset_seconds: the time in the reference file at which the other file starts. Positive: the other recording started later, so place its clip offset_seconds after the start of the reference clip; negative: it started earlier. confidence (0-1) is the correlation at that offset and runner_up the best score more than 0.5 s away; reliable is true when confidence >= 0.3 and beats runner_up by at least 0.05. Precision is about 0.01 s. Fails with FFMPEG_FAILED when either file has no level changes to compare (silence, constant tone). Works on the file on disk with ffmpeg, not on the timeline; Premiere Pro is not needed. ffmpeg and ffprobe must be installed (see check_ffmpeg), else FFMPEG_NOT_FOUND.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "reference_path": "<reference_path>",
      "path": "<path>"
    },
    "name": "find_audio_sync_offset_between_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path of the other recording to align to the reference (for example the external audio).
max_offsetNoLargest offset to consider in either direction, in seconds. Default 60.
audio_streamNoWhich audio stream to use, 0-based among the file's audio streams (see probe_media_file). Default 0.
reference_pathYesAbsolute path of the reference recording (for example the camera file).
analyze_secondsNoHow much of each file to compare, from its start, in seconds. Must be longer than the expected offset. Default 600.
timeout_secondsNoStop ffmpeg and fail with TIMEOUT after this many seconds. Default 600.
reference_audio_streamNoAudio stream of the reference file to use, 0-based among its audio streams. Default 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well past the annotations (readOnly/idempotent/non-destructive) by disclosing output semantics in detail — sign convention of offset_seconds, confidence/runner_up/reliable thresholds, and ~0.01 s precision. It also enumerates failure modes (FFMPEG_FAILED on silence or constant tone, FFMPEG_NOT_FOUND, TIMEOUT) and the external binary dependency, which is exactly the operational context an agent needs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core purpose and the returned value's sign convention, then layers reliability and failure details in a logical order. It is a single dense paragraph with no wasted sentences, though the confidence/runner_up/reliable clause is compressed enough to require a careful read.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 7 parameters, a required ffmpeg dependency, and no output schema, the description covers return values, interpretation of signs, reliability thresholds, precision, environment prerequisites, and error codes. Nothing an agent needs to call it correctly and interpret results is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so each parameter is already documented in the schema (absolute paths, max_offset default 60, analyze_seconds must exceed expected offset, stream indices). The description adds little parameter-level meaning beyond the sign convention of the returned offset. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Find how far apart two recordings of the same event are in time') plus the mechanism (cross-correlation of loudness envelopes) and concrete scenarios (camera vs external recorder, two cameras). This is readily distinguishable from siblings like concat_media_files or get_audio_waveform_of_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear usage context: the two-recording scenarios, and an explicit scope boundary ('works on the file on disk with ffmpeg, not on the timeline; Premiere Pro is not needed'). It also points to check_ffmpeg as a prerequisite. It stops short of stating when not to use it or naming a competing alternative, so it is short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools