offmute-v2 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +249 -58
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Southbridge
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,95 +1,286 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
speaker-labelled, tone-annotated transcript with accurate timestamps comes out (SRT / Markdown /
|
|
5
|
-
JSON). It fuses a multimodal LLM (content, diarization, tone, speaker identity) with an ASR model
|
|
6
|
-
(word-level timing), aligned together. Runs as an npx CLI, a Node library, and in the browser.
|
|
3
|
+
# offmute-v2 🎙️⏱️
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
### `npx offmute-v2 meeting.mp4`
|
|
6
|
+
|
|
7
|
+
**Timestamp-correct, diarized meeting transcription.** Point it at a video or audio file and get
|
|
8
|
+
back a transcript where every speaker turn lands on the right millisecond — labelled with the
|
|
9
|
+
speaker's name (when it can be inferred) and their tone — as **SRT**, **Markdown**, and **JSON**.
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/offmute-v2)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
[](#requirements)
|
|
14
|
+
|
|
15
|
+
📝 **Read the full write-up — _"offmute-v2: GLM vs Opus"_ — coming soon at
|
|
16
|
+
[southbridge.ai/blog/offmute-v2-glm-vs-opus](http://southbridge.ai/blog/offmute-v2-glm-vs-opus)**
|
|
17
|
+
|
|
18
|
+
</div>
|
|
10
19
|
|
|
11
20
|
---
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
It's the successor to [offmute](https://github.com/southbridgeai/offmute): the same great diarized,
|
|
23
|
+
tone-aware transcripts — now with **real timestamps**, SRT output, a resumable pipeline, and a
|
|
24
|
+
browser build. No single model is good at everything, so offmute-v2 uses each for what it's best at
|
|
25
|
+
and **fuses** them.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
export GEMINI_API_KEY=... # multimodal understanding (or GOOGLE_API_KEY)
|
|
29
|
+
export ASSEMBLYAI_API_KEY=... # word-level timing
|
|
30
|
+
|
|
31
|
+
npx offmute-v2 meeting.mp4 -i "Panel of founders; label them by name."
|
|
32
|
+
# → meeting.srt meeting.md meeting.json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
That's it. `bunx offmute-v2 meeting.mp4` works too.
|
|
36
|
+
|
|
37
|
+
## What you get
|
|
38
|
+
|
|
39
|
+
A clean, sub-second-aligned, speaker-labelled transcript with tone — same content rendered three ways:
|
|
40
|
+
|
|
41
|
+
**`meeting.srt`** (drop straight onto the video):
|
|
42
|
+
|
|
43
|
+
```srt
|
|
44
|
+
1
|
|
45
|
+
00:00:00,160 --> 00:00:00,720
|
|
46
|
+
Speaker D: GPU
|
|
47
|
+
|
|
48
|
+
2
|
|
49
|
+
00:00:01,199 --> 00:00:05,440
|
|
50
|
+
Presenter: And I'm inspired. I think I'm going to apply to NTU this fall. (confident, joking)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**`meeting.md`** (skimmable, grouped by speaker, with talk-time):
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
*Duration: 1914s · Speakers: 5*
|
|
57
|
+
|
|
58
|
+
## Speakers
|
|
59
|
+
- **Presenter** (1461s)
|
|
60
|
+
- **Speaker B** (97s) · **Speaker C** (87s) · ...
|
|
61
|
+
|
|
62
|
+
## Transcript
|
|
63
|
+
[00:00] **Speaker D**: GPU
|
|
64
|
+
[00:01] **Presenter** *(confident, joking)*: And I'm inspired. I think I'm going to apply to NTU this fall.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**`meeting.json`** — every segment with `start`/`end`, `speaker`, `text`, `tone[]`, `timingSource`,
|
|
68
|
+
`confidence`, and word-level timings — for downstream tooling.
|
|
14
69
|
|
|
15
|
-
|
|
16
|
-
**Claude Code** — as a head-to-head of how each does on a hard, AI-resistant build (combining the
|
|
17
|
-
ideas from [offmute], [meeting-diary], and [ipgu] into one timestamp-accurate diarizer):
|
|
70
|
+
## Why it's accurate
|
|
18
71
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| [`opus`](../../tree/opus) | **Claude Opus 4.8** | `offmute-v2@opus` | the comparison build, preserved with full history |
|
|
23
|
-
| `master` | — | — | this overview + the current primary (tracks `glm` for now; may diverge) |
|
|
72
|
+
LLMs are brilliant at *understanding* speech (who's talking, through interruptions, in a crowd,
|
|
73
|
+
with tone) but [terrible at timestamps](#how-it-works). ASR models are the opposite: sub-second
|
|
74
|
+
timing, but mediocre diarization and no sense of tone. offmute-v2 runs **both** and marries them:
|
|
24
75
|
|
|
25
|
-
|
|
26
|
-
|
|
76
|
+
| Job | Tool | Why |
|
|
77
|
+
|-----|------|-----|
|
|
78
|
+
| **WHO / HOW** — speakers, names, tone, hard audio | multimodal **LLM** (Gemini) | infers names from context, hears tone, handles crowds & interruptions |
|
|
79
|
+
| **WHEN** — word-level timestamps | **ASR** (AssemblyAI / Groq Whisper) | sub-second accurate; LLM timestamps drift *minutes* over a long file |
|
|
80
|
+
| **fuse** | edit-distance **alignment** | transfers the ASR's clock onto the LLM's richer words |
|
|
27
81
|
|
|
28
|
-
|
|
82
|
+
```mermaid
|
|
83
|
+
flowchart LR
|
|
84
|
+
IN["🎬 audio / video"] --> PRE["preprocess<br/>16kHz mono + keyframes"]
|
|
85
|
+
PRE --> LLM["multimodal LLM<br/>diarize · transcribe · tone<br/><i>(per chunk)</i>"]
|
|
86
|
+
PRE --> ASR["ASR<br/>word-level timestamps<br/><i>(whole file)</i>"]
|
|
87
|
+
LLM --> AL["align<br/>edit-distance fuse"]
|
|
88
|
+
ASR --> AL
|
|
89
|
+
AL --> GF["gap-fill<br/>recover dropped speech"]
|
|
90
|
+
GF --> CON["consistency<br/>stable speakers"]
|
|
91
|
+
CON --> ID["identify names<br/><i>(optional, level 3)</i>"]
|
|
92
|
+
ID --> FIN["finalize →<br/>SRT · MD · JSON"]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Measured** on a hand-checked 32-minute talk (founder presentation + audience Q&A): **≈8% word
|
|
96
|
+
error rate** and **~99% word-level speaker attribution**, with turn boundaries riding AssemblyAI's
|
|
97
|
+
word timing (first cue at `00:00:00,160`, exactly matching ground truth). Full methodology, runs,
|
|
98
|
+
and an independent re-score live in [`docs/`](#receipts--how-this-repo-was-built) and the article.
|
|
29
99
|
|
|
30
|
-
|
|
100
|
+
## Features
|
|
31
101
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
-
|
|
102
|
+
- 🎯 **Timestamp-correct** — word-level timing from ASR, fused onto LLM text by alignment.
|
|
103
|
+
- 🎭 **Diarization + tone** — separates speakers through interruptions; annotates `(laughing)`,
|
|
104
|
+
`(hesitant)`, `(confident)`, …
|
|
105
|
+
- 🧑🤝🧑 **Three levels of speaker labelling** — separation → stable `Speaker A/B` → real names
|
|
106
|
+
inferred from context (`--level 3`).
|
|
107
|
+
- 🎬 **Video-aware** — samples keyframes for visual context (who's on screen, demos, slides).
|
|
108
|
+
- ⚡ **Chunked + concurrent** — long files are split with overlap and stitched back with
|
|
109
|
+
**ownership-partition** dedup (no double-printed sentences at chunk seams).
|
|
110
|
+
- ♻️ **Resumable & stoppable** — every stage caches to disk; re-runs skip finished work, Ctrl-C
|
|
111
|
+
leaves partials. The cache is keyed on the input **and** the config, so changing `--model` never
|
|
112
|
+
serves you a stale transcript.
|
|
113
|
+
- 🔀 **Pluggable providers** — Gemini for the LLM; AssemblyAI *or* Groq Whisper for timing.
|
|
114
|
+
- 🌐 **Runs in the browser** — a pure, node-free core + `fetch` providers + ffmpeg.wasm.
|
|
115
|
+
- 🔎 **Fully inspectable** — every LLM prompt+response is logged to `llm-calls.jsonl`; all
|
|
116
|
+
intermediates are plain JSON.
|
|
38
117
|
|
|
39
|
-
|
|
118
|
+
## Usage
|
|
40
119
|
|
|
41
|
-
|
|
120
|
+
### CLI
|
|
42
121
|
|
|
43
122
|
```bash
|
|
44
|
-
|
|
45
|
-
export ASSEMBLYAI_API_KEY=... # word-level timing
|
|
46
|
-
|
|
47
|
-
# primary (GLM) build:
|
|
48
|
-
npx offmute-v2@latest meeting.mp4
|
|
49
|
-
# explicitly pin a build:
|
|
50
|
-
npx offmute-v2@glm meeting.mp4
|
|
51
|
-
npx offmute-v2@opus meeting.mp4
|
|
123
|
+
npx offmute-v2 <input> [options]
|
|
52
124
|
```
|
|
53
125
|
|
|
54
|
-
|
|
55
|
-
|
|
126
|
+
| Option | Default | Description |
|
|
127
|
+
|--------|---------|-------------|
|
|
128
|
+
| `-o, --output <dir>` | `./output` | where to write `*.srt` / `*.md` / `*.json` |
|
|
129
|
+
| `--instructions <text>` | – | guide diarization / labelling, e.g. `"host is Alice; group callers as 'Caller'"` |
|
|
130
|
+
| `--model <name>` | `gemini-2.5-flash` | multimodal LLM (`gemini-2.5-pro`, `gemini-3.1-pro-preview`, `gemini-flash-latest`, …) |
|
|
131
|
+
| `--level <1\|2\|3>` | `2` | 1 = separation · 2 = stable anon · 3 = identify names |
|
|
132
|
+
| `--timestamped <p>` | `assemblyai` | timing provider: `assemblyai` · `whisper-groq` · `none` |
|
|
133
|
+
| `--reasoner <name>` | `deepseek-chat` | text model for the name-identification pass (level 3) |
|
|
134
|
+
| `--chunk-seconds <n>` | `600` | chunk length · `--overlap-seconds` (default `60`) |
|
|
135
|
+
| `--formats <list>` | `srt,md,json` | which outputs to write |
|
|
136
|
+
| `--passes <list>` | all | run/resume a subset of stages |
|
|
137
|
+
| `--force` | – | ignore caches and recompute |
|
|
138
|
+
| `--only-chunk <n>` | – | process a single chunk (debugging) |
|
|
139
|
+
| `-i, --intermediates <dir>` | auto | cache dir (auto-derived per input) |
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npx offmute-v2 meeting.mp4 --level 3 # name the speakers
|
|
143
|
+
npx offmute-v2 meeting.mp4 --model gemini-2.5-pro # higher quality
|
|
144
|
+
npx offmute-v2 talk.mov --timestamped whisper-groq # free/fast timing, no AssemblyAI
|
|
145
|
+
npx offmute-v2 meeting.mp4 --passes align,consistency,finalize # resume from cache
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Library
|
|
149
|
+
|
|
150
|
+
The primary line takes a single options object (`input` and `outputDir` are required):
|
|
56
151
|
|
|
57
152
|
```ts
|
|
58
153
|
import { transcribe } from "offmute-v2";
|
|
59
154
|
|
|
60
|
-
const { segments, speakers } = await transcribe({
|
|
155
|
+
const { segments, speakers, metadata } = await transcribe({
|
|
61
156
|
input: "meeting.mp4",
|
|
62
157
|
outputDir: "./out",
|
|
63
|
-
model: "gemini-flash-latest",
|
|
158
|
+
model: "gemini-flash-latest",
|
|
159
|
+
level: 3,
|
|
160
|
+
instructions: "Three-person panel; label by name.",
|
|
64
161
|
formats: ["srt", "md", "json"],
|
|
65
|
-
|
|
162
|
+
apiKeys: { gemini: "...", assemblyai: "..." }, // optional; falls back to env
|
|
66
163
|
});
|
|
164
|
+
|
|
165
|
+
console.log(segments[0]); // { start, end, speaker, text, tone, timingSource, ... }
|
|
67
166
|
```
|
|
68
167
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
identify) and in the library call shape (the Opus build uses `transcribe(input, options)`). See each
|
|
72
|
-
branch's README and [`RELEASING.md`](RELEASING.md) for the `latest` / `glm` / `opus` npm tags.
|
|
168
|
+
Individual stages (`alignSegments`, `assignGlobalSpeakers`, `finalizeSegments`, formatters, …) are
|
|
169
|
+
exported too, so you can build your own pipeline.
|
|
73
170
|
|
|
74
|
-
|
|
171
|
+
### Browser
|
|
75
172
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
173
|
+
The fusion core (align / consistency / identify / finalize / format) is pure TypeScript with **zero
|
|
174
|
+
node-only imports**, so it bundles tiny and runs in the browser via `offmute-v2/browser` — using
|
|
175
|
+
`fetch`-based providers and `ffmpeg.wasm` for in-browser audio extraction. See
|
|
176
|
+
[`docs/`](#receipts--how-this-repo-was-built) / the browser example for the integration seam.
|
|
177
|
+
|
|
178
|
+
## How it works
|
|
179
|
+
|
|
180
|
+
A multi-stage pipeline where each stage persists a JSON intermediate (so it's resumable and
|
|
181
|
+
debuggable):
|
|
182
|
+
|
|
183
|
+
1. **preprocess** — ffmpeg → 16 kHz mono FLAC + scene-aware keyframes (a 9.6 GB `.mov` becomes a
|
|
184
|
+
~76 MB FLAC in seconds).
|
|
185
|
+
2. **describe** — a quick multimodal pass builds a meeting summary + speaker roster to prime
|
|
186
|
+
transcription.
|
|
187
|
+
3. **llm-transcribe** — each chunk goes to the LLM for verbatim text, diarization, and tone. Output
|
|
188
|
+
is plain text with coarse `mm:ss` markers, parsed leniently (truncated text degrades gracefully
|
|
189
|
+
where truncated JSON would be unrecoverable — a lesson from [ipgu](#credits)).
|
|
190
|
+
4. **timestamped** — the whole file goes to ASR for word-level timing + a speaker backbone.
|
|
191
|
+
5. **align** — the heart: the LLM's token stream is aligned against the ASR word stream with a
|
|
192
|
+
Needleman–Wunsch edit-distance DP, transferring accurate word times onto the richer LLM text.
|
|
193
|
+
6. **gap-fill** — anywhere ASR heard speech that no LLM segment covers, an ASR fallback is inserted
|
|
194
|
+
so nothing is dropped.
|
|
195
|
+
7. **consistency** — the ASR voice clusters act as a global backbone, merging the LLM's per-chunk
|
|
196
|
+
labels into stable speakers (and fixing ASR over-splits).
|
|
197
|
+
8. **identify** *(level 3)* — a reasoning model maps `Speaker A` → real names using context + a
|
|
198
|
+
voice-cluster hint.
|
|
199
|
+
9. **finalize** — overlap fixes, clamping, readable subtitle-sized blocks, and SRT/MD/JSON.
|
|
200
|
+
|
|
201
|
+
> [!NOTE]
|
|
202
|
+
> The hard parts of this problem are **chunk overlap** and **alignment**. offmute-v2 partitions
|
|
203
|
+
> overlap by *ownership* (each word is emitted by exactly one chunk) so sentences are never
|
|
204
|
+
> double-printed at seams, and aligns the *whole* chunk in one DP pass so common words like "it"
|
|
205
|
+
> can't mis-match to a later occurrence.
|
|
79
206
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
207
|
+
## Built twice, in the open: GLM vs Opus
|
|
208
|
+
|
|
209
|
+
This repo is also an **agent-vs-agent experiment**. offmute-v2 was built **twice, from one identical
|
|
210
|
+
prompt**, by two different models running in **Claude Code** — a head-to-head on a hard,
|
|
211
|
+
AI-resistant build (fusing the ideas of [offmute], [meeting-diary], and [ipgu] into one
|
|
212
|
+
timestamp-accurate diarizer):
|
|
213
|
+
|
|
214
|
+
| Branch | Built by | npm tag | What it is |
|
|
215
|
+
|--------|----------|---------|------------|
|
|
216
|
+
| [`master`](../../tree/master) | GLM line + post-launch fixes | `offmute-v2@latest` | the daily-driven, hardened build (this README) |
|
|
217
|
+
| [`glm`](../../tree/glm) | **GLM-5.2** | `offmute-v2@glm` | the frozen GLM experiment build |
|
|
218
|
+
| [`opus`](../../tree/opus) | **Claude Opus 4.8** | `offmute-v2@opus` | the frozen Opus experiment build |
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
npx offmute-v2@glm meeting.mp4 # the GLM build, exactly as submitted
|
|
222
|
+
npx offmute-v2@opus meeting.mp4 # the Opus build, exactly as submitted
|
|
83
223
|
```
|
|
84
224
|
|
|
225
|
+
The `glm` and `opus` branches have **independent histories** — each is the full, unedited commit
|
|
226
|
+
trail of that model's build, every review round, and every fix. The headline finding (spoiler):
|
|
227
|
+
once a chunk-overlap dedup bug is accounted for, the two are a near dead-heat on accuracy, and the
|
|
228
|
+
differences are in code conventions, error DX, and packaging. The full analysis is in the article.
|
|
229
|
+
|
|
230
|
+
## Receipts & how this repo was built
|
|
231
|
+
|
|
232
|
+
Everything is open for inspection:
|
|
233
|
+
|
|
234
|
+
- **Per-branch review trails** (on [`glm`](../../tree/glm/docs) / [`opus`](../../tree/opus/docs)):
|
|
235
|
+
`docs/spec.md`, `docs/review-1/`, `docs/review-2/` (run-throughs, code reads, an independent
|
|
236
|
+
review, and each model's diagnosed fixes), and the append-only `intermediates/process_log_*.md`
|
|
237
|
+
dev journals.
|
|
238
|
+
- **Releasing & npm tags:** [`RELEASING.md`](RELEASING.md) — published via GitHub Actions **npm
|
|
239
|
+
Trusted Publishing (OIDC)**, no tokens, with provenance.
|
|
240
|
+
|
|
241
|
+
## Diarization levels
|
|
242
|
+
|
|
243
|
+
1. **Separation** — who speaks when.
|
|
244
|
+
2. **Anonymous-consistent** — `Speaker A/B`, stable across the whole file *(default)*.
|
|
245
|
+
3. **Identification** — real names inferred from context (needs `DEEPSEEK_API_KEY`, or point
|
|
246
|
+
`--reasoner` at another provider). Use `--instructions` to steer (e.g. *"everyone except the
|
|
247
|
+
host is 'Audience'"*).
|
|
248
|
+
|
|
85
249
|
## Requirements
|
|
86
|
-
- Node ≥ 20 and `ffmpeg`/`ffprobe` on PATH (CLI / library). Browser builds use ffmpeg.wasm.
|
|
87
|
-
- API keys from env or injected: `GEMINI_API_KEY` (or `GOOGLE_API_KEY`), `ASSEMBLYAI_API_KEY`;
|
|
88
|
-
optional `DEEPSEEK_API_KEY` / `GROQ_API_KEY` depending on the build/options.
|
|
89
250
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
251
|
+
- **Node ≥ 20** and **`ffmpeg`/`ffprobe`** on `PATH` (CLI / library). The browser build uses
|
|
252
|
+
ffmpeg.wasm instead.
|
|
253
|
+
- **API keys** (from env or the `apiKeys` option):
|
|
254
|
+
- `GEMINI_API_KEY` (or `GOOGLE_API_KEY`) — required.
|
|
255
|
+
- `ASSEMBLYAI_API_KEY` — required for timing (or use `--timestamped whisper-groq` + `GROQ_API_KEY`).
|
|
256
|
+
- `DEEPSEEK_API_KEY` — optional, for `--level 3` name identification.
|
|
257
|
+
|
|
258
|
+
## Development
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
git clone https://github.com/SouthBridgeAI/offmute-v2.git
|
|
262
|
+
cd offmute-v2 # master = the primary build
|
|
263
|
+
npm ci
|
|
264
|
+
npm run typecheck && npm run lint && npm test
|
|
265
|
+
npm run build # tsup → dist/ (node + browser bundles)
|
|
266
|
+
npm run dev -- meeting.mp4 # run from source
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
To compare against the experiment builds, check out the [`glm`](../../tree/glm) or
|
|
270
|
+
[`opus`](../../tree/opus) branch (the Opus build uses Bun: `bun install && bun run build`).
|
|
271
|
+
|
|
272
|
+
## Credits
|
|
273
|
+
|
|
274
|
+
Built on three predecessors, with their hard-won lessons carried forward:
|
|
275
|
+
|
|
276
|
+
- **[offmute]** — multimodal describe→transcribe, diarization, tone.
|
|
277
|
+
- **[meeting-diary]** — ASR word-timestamps + speaker diarization.
|
|
278
|
+
- **[ipgu]** — chunk/merge discipline and structured extraction from LLM output.
|
|
279
|
+
|
|
280
|
+
Created by [Southbridge](https://southbridge.ai). Thanks to the model teams — including
|
|
281
|
+
[z.ai](https://z.ai) for GLM-5.2 and Anthropic for Claude Opus.
|
|
282
|
+
|
|
283
|
+
**License:** Apache-2.0.
|
|
93
284
|
|
|
94
285
|
[offmute]: https://github.com/southbridgeai/offmute
|
|
95
286
|
[meeting-diary]: https://github.com/southbridgeai/meeting-diary
|