mirror of
https://github.com/wiltodelta/remove-ai-watermarks.git
synced 2026-08-10 08:00:32 +02:00
Prevent ffmpeg pipe probe deadlock
This commit is contained in:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user