Long-file streaming and chunking strategy #8

Closed
opened 2026-09-01 20:38:54 +00:00 by Mark · 1 comment
Owner

Smoke-tested 3.4-hour Lex Fridman episode fine (60s transcribe). But what about 8-hour files? 24-hour?

Unknowns:

  • Memory: does audio load fit in RAM at 24h? (24h × 16kHz × 4 bytes = 5.5GB — too much for single load)
  • VRAM: does the model's KV cache hold for arbitrarily long context?
  • Disk: where do intermediate chunks go?

What needs building:

  • Stream audio from file in chunks of N minutes (default: 30)
  • Transcribe each chunk independently
  • Stitch chunks back together with timestamp offsets
  • Cleanup intermediate files unless --keep-chunks

Smoke test: find or generate a 6+ hour audio file (Lex Fridman #464 is ~6h), verify end-to-end with timestamps that match continuous listening.

Smoke-tested 3.4-hour Lex Fridman episode fine (60s transcribe). But what about 8-hour files? 24-hour? **Unknowns:** - Memory: does audio load fit in RAM at 24h? (24h × 16kHz × 4 bytes = 5.5GB — too much for single load) - VRAM: does the model's KV cache hold for arbitrarily long context? - Disk: where do intermediate chunks go? **What needs building:** - Stream audio from file in chunks of N minutes (default: 30) - Transcribe each chunk independently - Stitch chunks back together with timestamp offsets - Cleanup intermediate files unless `--keep-chunks` **Smoke test:** find or generate a 6+ hour audio file (Lex Fridman #464 is ~6h), verify end-to-end with timestamps that match continuous listening.
Mark 2026-09-05 17:15:36 +00:00
Author
Owner

Cross-link: composition of this issue's streaming/chunking work with #16's chunk-resume work was audited post-merge (kanban card t_02afa75b, fixit board). Full integration summary is on #16; follow-up code work is tracked on #21.

Relevant to this issue specifically:

  • chunking.plan_chunks gives stable chunk indices across runs — pure function of (duration_sec, chunk_minutes), no wall clock, no random. This is what makes #16's resume join safe: the state file matches completed work back to planned chunks by index alone.
  • ffprobe duration jitter is tolerated. A +0.5s difference in the reported duration of the same file shifts only the final chunk's end_sec; every non-final (index, start_sec) pair is byte-identical, so a resume after a re-probe does not mis-join or re-run completed chunks.
  • --chunk-minutes changing between runs is hard-rejected, not silently mis-joined — state.validate_state raises on chunk_seconds mismatch.
  • Gap: audio_stream.decode_chunk is only tested in isolation (1-second ffmpeg sine in tests/test_audio_stream.py). No test drives the streaming decode path and the resume loop together over a long file. #21 item 3 adds a 10h / crash-at-hour-7 (chunk index 14) integration test covering both halves, asserting no duplicate and no missing segments across the full timeline.
Cross-link: composition of this issue's streaming/chunking work with #16's chunk-resume work was audited post-merge (kanban card `t_02afa75b`, fixit board). Full integration summary is on #16; follow-up code work is tracked on #21. Relevant to this issue specifically: - **`chunking.plan_chunks` gives stable chunk indices across runs** — pure function of `(duration_sec, chunk_minutes)`, no wall clock, no `random`. This is what makes #16's resume join safe: the state file matches completed work back to planned chunks by index alone. - **`ffprobe` duration jitter is tolerated.** A +0.5s difference in the reported duration of the same file shifts only the final chunk's `end_sec`; every non-final `(index, start_sec)` pair is byte-identical, so a resume after a re-probe does not mis-join or re-run completed chunks. - **`--chunk-minutes` changing between runs is hard-rejected**, not silently mis-joined — `state.validate_state` raises on `chunk_seconds mismatch`. - **Gap: `audio_stream.decode_chunk` is only tested in isolation** (1-second ffmpeg sine in `tests/test_audio_stream.py`). No test drives the streaming decode path and the resume loop together over a long file. #21 item 3 adds a 10h / crash-at-hour-7 (chunk index 14) integration test covering both halves, asserting no duplicate **and** no missing segments across the full timeline.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/whisper-transcribe#8
No description provided.