How Transcript Caching Prevents Re-Transcription of Unchanged Video Sources in video-use
video-use avoids unnecessary ElevenLabs Scribe API calls by storing each transcript as a JSON file in transcripts/<video-stem>.json and returning the existing file whenever the cache key is matched.
The browser-use/video-use pipeline relies on transcript caching to eliminate redundant work and API costs. When a video is processed, the helper scripts check the edit directory for an existing transcript artifact before initiating any expensive audio extraction or HTTP request. This design makes repeated runs against the same source material both fast and free of duplicated billing.
Single-Video Cache Check in helpers/transcribe.py
In helpers/transcribe.py, the transcribe_one function implements the core guard logic. It constructs the output path as edit_dir / "transcripts" / f"{video_path.stem}.json" and checks out_path.exists(). When that file is present, the function prints a cached notice and returns the path immediately without contacting the ElevenLabs Scribe API.
from pathlib import Path
from helpers.transcribe import transcribe_one, load_api_key
video_path = Path("media/example.mp4")
edit_dir = Path("my_edit")
api_key = load_api_key()
# First run: transcript is created via the ElevenLabs API
transcript_path = transcribe_one(video_path, edit_dir, api_key)
# Subsequent run: cache hit, no API call
# Output: cached: example.json
transcript_path = transcribe_one(video_path, edit_dir, api_key)
Batch Filtering in helpers/transcribe_batch.py
The transcribe_batch function scales this behavior across many files. It partitions the input list into cached and pending items using the expression already_cached = [v for v in videos if (edit_dir / "transcripts" / f"{v.stem}.json").exists()]. Videos in that list are omitted from the upload queue, and only the pending subset is sent to Scribe.
from pathlib import Path
from helpers.transcribe_batch import transcribe_batch
from helpers.transcribe import load_api_key
videos = list(Path("media").glob("*.mp4"))
edit_dir = Path("my_edit")
api_key = load_api_key()
# Sample output: found 10 videos (7 cached, 3 to transcribe)
transcribe_batch(videos, edit_dir, api_key)
Cache Keys and Immutable Artifacts
The cache key is derived from the stem of the video file—the filename without its extension. As documented in SKILL.md, the workflow treats transcripts as "immutable outputs of immutable inputs," which guarantees idempotency for repeated runs on identical, unrenamed sources. If a video file is renamed or its content is altered, the corresponding JSON file will not be found, and the helper will treat it as pending, performing a fresh transcription.
Summary
helpers/transcribe.pychecksout_path.exists()insidetranscribe_oneand returns the cached JSON on a hit.helpers/transcribe_batch.pybuildsalready_cachedand pending lists so only uncached videos are sent to the ElevenLabs Scribe API.- Cache key: the video file stem, stored under
transcripts/<video-stem>.jsonin the edit directory. - Result: unchanged sources avoid re-transcription, saving bandwidth, time, and API quota.
Frequently Asked Questions
Where does video-use store cached transcripts?
Cached transcripts are stored as JSON files in the edit directory under the transcripts/ folder, using the pattern transcripts/<video-stem>.json. This path is computed directly from the input video filename.
What happens if a video is renamed or its content changes?
If a video file is renamed or its content is altered, the corresponding JSON file will not be found under the expected stem-based path. The helper then treats the video as pending and performs a fresh transcription.
Which API does video-use call when a transcript is not cached?
When no cached JSON exists, the helpers send the video to the ElevenLabs Scribe API for transcription. Both transcribe_one and transcribe_batch wrap this upload and polling logic.
How does batch transcription skip already cached videos?
transcribe_batch in helpers/transcribe_batch.py filters the input list with a list comprehension that checks (edit_dir / "transcripts" / f"{v.stem}.json").exists(). Videos that satisfy this condition are omitted from the upload queue, so only pending items are sent to the ElevenLabs Scribe API.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →