Transcription cuts a speaker's phrases twenty-five at a time, not one ffmpeg process each (#684) #1027
Loading…
Reference in a new issue
No description provided.
Delete branch "perf/684-batch-ffmpeg-cuts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #684.
With voice-activity detection on,
transcribe_session_vadspawned one ffmpeg process per speech span, in sequence: about 213 for the 30-minute fixture scene, on the order of 1,300 for a three-hour, five-speaker session. The cost was process start-up, not decoding.What changes
ffmpeg -ss a -t d -i track.wav -ss b -t e -i track.wav … -map 0:a:0 … out0 -map 1:a:0 … out1.Each span keeps its own input seek, decoder and resampler and the same
-ss/-tstrings, so each output is what_cut_segmentwrites._cut_segment, so bad audio raises the same error from the same place. A timed-out batch propagates rather than multiplying the wait. Temp files have the same directory and lifetime; cleanup is tested on every path, cancellation included._cut_segmentis unchanged.Proof the output is the same
Measured (local, Docker)
tests/test_synthetic_session_guards.pyA test-only memo of
silencedetectper unchanged track (keyed on path, inode, size, mtime and thresholds) is part of the second row. The issue's "17 minutes" was stale: the module was already near three.Checked
tests/test_vad_batch_cut.py: 28 passed.docs/OPERATIONS.mdand the changelog fragment say what a fallback looks like in the log.Left for later
Session assembly in the harness (one Opus decode per clip, 224 processes) is now half the guards module and the largest harness step; the same batching would help, with the same byte-compare discipline, as its own change. xdist is not worth it here (a module-scoped fixture rebuilt per worker;
ci.ymlalready records-n 4as a regression). The comment above the guards step inci.ymlquotes an old timing.🤖 Generated with Claude Code
CI on
526e636d: every job is green except CI / End-to-end journeys (keyboard) (run https://git.rhoving.com/rbrooks/Quest-Board/actions/runs/1790).The log:
e2e/j7-a-character.spec.js:440"Priya levels up",chooseFeatat line 655,getByRole('button', { name: 'Choose Sudden Charge' })not found after 10 s. The same journey passed on desktop and phone in this run. This PR changes onlyaudio_service.py's span cutting and backend tests, so it cannot have caused it.Cause and fix are in #1030 (the feat picker empties its list while a search is in flight, and a key pressed on a row in that moment is lost). Not re-pushed: this wants a re-run of that one job, then it merges.