Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

extract_audio_pcm detects "no audio stream" by matching ffmpeg's stderr text, so a wording change turns silent clips into hard errors

オープン 初心者向け
#9,630 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@wunianze666-netizen がすでに取り組んでいます。

2026年10月12日 から。

  • #9828 @wunianze666-netizen による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
backend

調査の方向性

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 existing if n == 0: return None check 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 ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

invoke-ai/InvokeAI のほかの issue

invoke-ai/InvokeAI の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。