fix(subgen): always extract audio via external ffmpeg#9
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.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.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 parameterswarnings (caught and ignored) immediately before each crash. The crashing files were single-track BluRay rips with DTS-HD audio.Test plan
🤖 Generated with Claude Code