Understanding the Packed Transcript Format and Phrase-Level Breakdown in Video-Use

The packed transcript format is a markdown representation generated by helpers/pack_transcripts.py that groups word-level Scribe JSON entries into speaker-aware phrases bounded by silence thresholds, producing a compact, editable transcript for video editing workflows.

The packed transcript is a core artifact in the browser-use/video-use repository designed to transform verbose word-level transcription data into a human-readable, token-efficient format. This markdown-based output enables editors to locate precise cut points using timecoded phrase ranges without parsing raw JSON files.

What Is the Packed Transcript Format?

The packed transcript is produced by the helpers/pack_transcripts.py script, which processes raw Scribe JSON transcripts containing individual word entries. According to the video-use source code, the script reads all *.json files from <edit_dir>/transcripts/ and compiles them into a single markdown document named takes_packed.md.

The format condenses word-level granularity into phrases—logical units of speech demarcated by silence thresholds or speaker changes. Each phrase line follows this structure:


[START-END]S<N> TEXT

  • START/END: Fixed-width timestamps (e.g., 012.34) generated by format_time()
  • S: Optional speaker tag (e.g., S0, S1) stripped from the speaker_id field
  • TEXT: The concatenated phrase content including audio event annotations in parentheses

How Phrase-Level Grouping Works

The phrase-level breakdown occurs in three distinct stages within the packing pipeline.

Entry Point and File Processing

The main() function serves as the entry point, parsing the --edit-dir argument and iterating through transcript files. For each JSON file, it delegates to pack_one_file(), which extracts the words array and invokes the grouping logic【https://github.com/browser-use/video-use/blob/main/helpers/pack_transcripts.py#L25-L33】.

The render_markdown() function then receives tuples of (name, duration, phrases) and assembles the final document structure【https://github.com/browser-use/video-use/blob/main/helpers/pack_transcripts.py#L37-L44】.

The Phrase Grouping Logic

The group_into_phrases() function walks the Scribe word list and flushes (finalizes) a phrase when any of three conditions is met:

  1. Silence threshold exceeded: When a spacing entry's gap (end-start) exceeds the user-supplied threshold (default 0.5 seconds), the current phrase is closed【https://github.com/browser-use/video-use/blob/main/helpers/pack_transcripts.py#L90-L99】
  2. Speaker change: When the speaker_id differs from the ongoing phrase's speaker, the phrase boundary is triggered【https://github.com/browser-use/video-use/blob/main/helpers/pack_transcripts.py#L107-L110】
  3. Long inter-token gap: If the next token's start time exceeds the silence threshold after the previous token's end, the phrase flushes【https://github.com/browser-use/video-use/blob/main/helpers/pack_transcripts.py#L111-L113】

While building phrases, the script tracks current_start and current_speaker. The flush() method concatenates cleaned word strings (including audio_event tokens wrapped in parentheses) and stores a dictionary with {start, end, text, speaker_id}【https://github.com/browser-use/video-use/blob/main/helpers/pack_transcripts.py#L58-L68】【https://github.com/browser-use/video-use/blob/main/helpers/pack_transcripts.py#L73-L81】.

Markdown Rendering

For each source file, the script emits a second-level heading displaying the transcript name, total duration, and phrase count:


## interview  (duration: 5m 12.3s, 42 phrases)

Individual phrases render as timestamped lines with optional speaker tags:

[000.00-002.15] S0 Good morning, thanks for joining us.
[002.20-005.67] S1 Absolutely, happy to be here.

Practical Usage and Code Examples

Generate packed transcripts using the command-line interface:


# Pack all transcripts with default 0.5s silence threshold

python helpers/pack_transcripts.py --edit-dir my_edit

# Use custom 0.8s threshold for longer phrases

python helpers/pack_transcripts.py --edit-dir my_edit --silence-threshold 0.8

The resulting takes_packed.md file begins with a header explanation followed by grouped phrases for each source file:


# Packed transcripts

Phrase-level, grouped on silences ≥ 0.5s or speaker change.
Use `[start-end]` ranges to address cuts in the EDL.

## interview  (duration: 5m 12.3s, 42 phrases)

  [000.00-002.15] S0 Good morning, thanks for joining us.
  [002.20-005.67] S1 Absolutely, happy to be here.
  [005.70-008.90] S0 Let's dive into the first topic…

Why the Packed Transcript Format Matters

The packed transcript format serves three critical functions in the video-use pipeline:

  • Compactness: Reduces massive JSON word arrays to kilobyte-sized markdown while preserving millisecond-precision boundaries
  • Editability: Editors can search phrase text and reference exact [start-end] ranges directly in Edit Decision Lists (EDLs)
  • Speaker Awareness: The optional S<N> tags enable rapid identification of speaker-specific cuts without JSON parsing

Summary

  • The packed transcript format is a markdown representation produced by helpers/pack_transcripts.py in the browser-use/video-use repository
  • Phrase-level breakdown occurs via group_into_phrases(), which flushes phrases on silence thresholds (default 0.5s), speaker changes, or long inter-token gaps
  • Each phrase renders as [START-END]S<N> TEXT with fixed-width timestamps and optional speaker identifiers
  • The script processes Scribe JSON from <edit_dir>/transcripts/ and outputs takes_packed.md for editorial workflows
  • Audio events are preserved in parentheses within the phrase text

Frequently Asked Questions

What triggers a phrase boundary in the packed transcript format?

A phrase boundary triggers when any of three conditions occurs: a silence gap exceeding the threshold (default 0.5 seconds), a change in speaker_id, or when the next token's start time exceeds the threshold after the previous token's end. These rules are implemented in group_into_phrases() within helpers/pack_transcripts.py.

How does the packed transcript format represent speaker changes?

When the speaker_id changes between words, the current phrase finalizes and a new phrase begins with the updated speaker. The markdown output appends speaker tags like S0 or S1 (stripping the "speaker_" prefix) immediately after the timestamp range, allowing editors to identify speakers without parsing JSON.

Where is the packed transcript script located in the video-use repository?

The core script resides at helpers/pack_transcripts.py in the browser-use/video-use repository. This file contains the main(), pack_one_file(), group_into_phrases(), and render_markdown() functions that implement the entire packing pipeline from JSON ingestion to markdown generation.

How do I customize the silence threshold for phrase grouping?

Pass the --silence-threshold argument when running the script, specifying the gap duration in seconds. The default value is 0.5 seconds, but you can increase it for longer phrases or decrease it for finer granularity. For example: python helpers/pack_transcripts.py --edit-dir my_edit --silence-threshold 0.8.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →