Skip to content

fix(subgen): always extract audio via external ffmpeg#9

Merged
arsac merged 1 commit intomainfrom
fix/subgen-pyav-dts-segfault
Apr 29, 2026
Merged

fix(subgen): always extract audio via external ffmpeg#9
arsac merged 1 commit intomainfrom
fix/subgen-pyav-dts-segfault

Conversation

@arsac
Copy link
Copy Markdown
Owner

@arsac arsac commented Apr 29, 2026

Summary

  • faster-whisper's internal PyAV decoder fails on certain DTS streams with Frame does not match AudioFifo parameters, corrupting PyAV state and causing a SIGSEGV on the next decode call. Documented at Purfview/whisper-standalone-win#236.
  • Subgen already ships extract_audio_track_to_memory() which uses ffmpeg-python (subprocess) and handles these files correctly. Upstream only invoked it for multi-track files; this patch makes external-ffmpeg extraction the default for any file with audio.
  • Switches from per-file curl to git clone --branch ${VERSION} for the upstream fetch — atomic, content-addressed, plays nicely with patch files.

Background

Subgen running on a node with shared GPU was crashing every ~6–10 minutes with a SIGSEGV in libc, hung GPU driver state, and cascading kubelet NotReady → etcd leader changes → KEDA scale-to-zero across the cluster. Logs showed repeated Frame does not match AudioFifo parameters warnings (caught and ignored) immediately before each crash. The crashing files were single-track BluRay rips with DTS-HD audio.

Test plan

  • Build the patched image, deploy, confirm no SIGSEGV across one full media scan
  • Confirm subgen produces subtitles for the previously-crashing DTS files
  • Confirm no regression on multi-track files (existing behavior path)

🤖 Generated with Claude Code

faster-whisper's internal PyAV decoder fails on certain DTS streams
with `Frame does not match AudioFifo parameters`, leaving PyAV in a
corrupted state that segfaults the process on the next decode call.
Documented at Purfview/whisper-standalone-win#236.

Subgen already has extract_audio_track_to_memory() which uses
ffmpeg-python (subprocess) and handles the same files cleanly. The
upstream code only invoked it for multi-track files; this patch
makes it the default for any file with audio.

Also switches from per-file curl to git clone for the upstream
fetch — atomic, content-addressed, and works with patch files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@arsac arsac merged commit 73870da into main Apr 29, 2026
3 of 5 checks passed
@arsac arsac deleted the fix/subgen-pyav-dts-segfault branch April 29, 2026 18:05
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