Find the sync offset between two recordings
find_audio_sync_offset_between_filesMeasure 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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path of the other recording to align to the reference (for example the external audio). | |
| max_offset | No | Largest offset to consider in either direction, in seconds. Default 60. | |
| audio_stream | No | Which audio stream to use, 0-based among the file's audio streams (see probe_media_file). Default 0. | |
| reference_path | Yes | Absolute path of the reference recording (for example the camera file). | |
| analyze_seconds | No | How much of each file to compare, from its start, in seconds. Must be longer than the expected offset. Default 600. | |
| timeout_seconds | No | Stop ffmpeg and fail with TIMEOUT after this many seconds. Default 600. | |
| reference_audio_stream | No | Audio stream of the reference file to use, 0-based among its audio streams. Default 0. |