Skip to content

fix(digest): handle silent (no-audio) videos instead of failing them (#57)#64

Merged
VGonPa merged 2 commits into
developfrom
fix/57-transcribe-silent-videos
Jul 2, 2026
Merged

fix(digest): handle silent (no-audio) videos instead of failing them (#57)#64
VGonPa merged 2 commits into
developfrom
fix/57-transcribe-silent-videos

Conversation

@VGonPa

@VGonPa VGonPa commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Diagnosis

Many "transcription failed" videos in the corpus are simply silent — no audio track at the source (muted clips, GIFs, screencasts). Verified rigorously: ffprobe on the complete download shows only a video stream, and yt-dlp -f bestaudio errors ("no audio format") on 4/4 checked videos — ruling out the "audio is a separate HLS/DASH stream that xbrain's raw-mp4 fetch missed" hypothesis. parakeet-mlx writes no output file for these, which xbrain's transcribe contract treats as a hard failure — even though xbrain's own design wants them attached as has_speech=false ("silent video" note).

Fix

scripts/xbrain-transcribe wraps parakeet-mlx. When parakeet exits 0 but wrote no file, it ffprobe-checks the media:

  • no audio stream → emit the empty-speech JSON → attaches as has_speech=false (silent video).
  • has audio but no output → surface as a real failure (parakeet choked) — not masked as silent.
    Non-zero parakeet exit propagates unchanged. Local, no API.

Validated on real data: the 5 videos that failed before now land as sin voz 5, fallidos 0, and 3 of them still got slide-frame descriptions.

Tests

tests/test_xbrain_transcribe.py locks all 4 branches + the no-ffprobe fallback.

VGonPa and others added 2 commits July 2, 2026 15:48
…57)

Diagnosis: a large share of "transcription failed" videos are simply SILENT —
no audio track at the source (muted clips, GIFs, screencasts; confirmed with
yt-dlp that no audio format exists, ruling out separate audio streams). parakeet
-mlx writes no output file for them, which xbrain's transcribe contract treats as
a hard failure — even though xbrain's own design wants them attached as
has_speech=false ("silent video" note).

- scripts/xbrain-transcribe: wraps parakeet-mlx; when parakeet exits 0 but wrote
  no file, `ffprobe`-checks the media — no audio stream → emit the empty-speech
  JSON (silent video); HAS audio but no output → surface as a real failure (not
  masked as silent). Non-zero parakeet exit propagates. Local, no API.
- docs: README "Transcriber wrapper" note + config.toml.example [transcribe].
- tests/test_xbrain_transcribe.py: locks the 4 branches (speech pass-through,
  silent→empty-speech, audio-but-empty→fail, parakeet-nonzero→propagate) + the
  no-ffprobe fallback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nscribe wrapper (PR #64 review)

Review (python-bug-finder) surfaced that xbrain reads the first NON-EMPTY *.json
by content (transcribe.py glob), not <stem>.json by name. Hardened accordingly:

- Detect "parakeet produced a transcript" as any non-empty *.json (mirrors
  xbrain), not `<stem>.json`.exists(). Fixes: an empty/stub file no longer fools
  the wrapper into skipping silent-classification (finding #1), and output under
  an unexpected filename is still detected (removes stem coupling, finding #4).
- `_confirmed_no_audio`: classify silent ONLY when ffprobe positively confirms no
  audio (returncode 0 + no audio stream). Unknown (no ffprobe / probe error) →
  real failure, never masked as silent (finding #3).
- `XBRAIN_PARAKEET` is shlex-split so a multi-token wrapper command works.
- Tests: empty-stub-not-output, non-stem output name, confirm-silence truth table
  (no-audio / audio / probe-error / no-ffprobe), + the four main() branches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@VGonPa VGonPa merged commit 2294ce0 into develop Jul 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant