Prevent ffmpeg pipe probe deadlock

This commit is contained in:
Victor Kuznetsov
2026-07-31 12:05:42 -07:00
parent f9a4e2ba10
commit 1fd859b58d
4 changed files with 49 additions and 4 deletions
+6 -3
View File
@@ -286,8 +286,12 @@ def raw_video_command(
ffmpeg = shutil.which("ffmpeg")
if ffmpeg is None:
raise RuntimeError("Video processing requires ffmpeg on PATH")
# The pipe format and stream geometry are already explicit. FFmpeg 6 can
# otherwise wait for its normal analysis window while the producer blocks
# on a full pipe, before the second (audio) input has been opened.
pipe_input = ["-analyzeduration", "0", "-probesize", "32", "-i", "pipe:0"]
frame_input = (
["-f", "nut", "-i", "pipe:0"]
["-f", "nut", *pipe_input]
if timestamped_input
else [
"-f",
@@ -298,8 +302,7 @@ def raw_video_command(
f"{width}x{height}",
"-r",
f"{fps:.12g}",
"-i",
"pipe:0",
*pipe_input,
]
)
command = [