extract_audio_pcm detects "no audio stream" by matching ffmpeg's stderr text, so a wording change turns silent clips into hard errors
メンテナーはふだん 2 日以内に返信
評価
調査の方向性
invokeai/app/util/video_audio.py の extract_audio_pcm() から始めて、ffmpeg の呼び出し、stderr テキストのチェック、既存の n == 0 ガードを確認してください。ffmpeg のエラー文言に依存しないアプローチを選び、無音のクリップが None を返し、実際の抽出失敗では引き続き AudioExtractionError が発生することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Found during review of invoke-ai/InvokeAI-7#64 (Concatenate Videos preserves audio). Not a regression — the code works against the ffmpeg binary we ship — but it is a latent fragility worth removing.
What
invokeai/app/util/video_audio.py, extract_audio_pcm() distinguishes "this container has no audio track" (a normal condition — Wan clips present this way) from "ffmpeg genuinely failed" by substring-matching ffmpeg's English error text:
if proc.returncode != 0:
stderr = proc.stderr.decode("utf-8", errors="replace")
# ffmpeg's phrasing for an input with no audio track ("Output file #0 does not
# contain any stream" / newer "does not contain any stream" variants).
if "does not contain any stream" in stderr:
return None
raise AudioExtractionError(...)
Why it matters
If that phrasing changes across ffmpeg versions, the branch stops matching and a silent input video raises AudioExtractionError instead of returning None. Callers treat None as "no audio, carry on", so the failure mode is that concatenating or trimming a silent clip starts erroring out — for a video that is perfectly valid.
The comment already hints the wording has moved once ("newer ... variants").
Today this is stable in practice because _ffmpeg_exe() resolves to imageio_ffmpeg.get_ffmpeg_exe(), a pinned bundled binary. The exposure is that IMAGEIO_FFMPEG_EXE lets a user point at a distro ffmpeg of any version or locale.
Possible fixes
- Probe for an audio stream first (
ffprobe -select_streams a) and skip the decode when there is none — decides on structure rather than on prose. - Or map the audio stream optionally (
-map 0:a:0?) so ffmpeg exits 0 with no audio output, and let the existingif n == 0: return Nonecheck handle it.
Either removes the dependency on error-message text. The second is a smaller change and the n == 0 guard is already there.
Scope
invokeai/app/util/video_audio.py only. Low priority.
- 主要言語
- TypeScript
- スター
- 28.6k
- フォーク
- 3k
- 平均マージ
- 3日 1時間
- マージ済み PR(30日)
- 124
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
invoke-ai/InvokeAI のほかの issue
-
[enhancement]: Bump PyPatchMatch to latest対応中かも @dunkeroni が 4 日前に担当しました。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
invoke-ai/InvokeAI#9826 · リアクション 2 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
メンテナーはふだん 2 日以内に返信
-
bug(graph): computed-condition If stalls on a Collect-of-Collect branch deeper than its conditionオープンbug nodes / workflows
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 2 日以内に返信
invoke-ai/InvokeAI の issue をすべて見る
似ている issue
-
area:workflow bug ready-for-human
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
fil-donadoni/tolaria#6108 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/rocketmq-dashboard#7234 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vitest-dev/vitest#11656 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
ehmpathy/rhachet-roles-bhrain#655 ·
メンテナーはふだん 1 日以内に返信