fix: resolve deadlock during video encoding by suppressing ffmpeg stdout/stderr logs

This commit is contained in:
fiatcode 2026-02-28 10:45:53 +07:00
parent 62685b60be
commit bdcb2b685e

View file

@ -506,7 +506,7 @@ def encode_video(
height, width = first_frame.shape[:2] height, width = first_frame.shape[:2]
# Build FFmpeg encode command # Build FFmpeg encode command
ffmpeg_cmd = ["ffmpeg", "-y"] ffmpeg_cmd = ["ffmpeg", "-y", "-v", "error"]
ffmpeg_cmd.extend(enc_in_args) ffmpeg_cmd.extend(enc_in_args)
ffmpeg_cmd.extend( ffmpeg_cmd.extend(
[ [
@ -546,7 +546,7 @@ def encode_video(
proc = subprocess.Popen( proc = subprocess.Popen(
ffmpeg_cmd, ffmpeg_cmd,
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stdout=subprocess.DEVNULL,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
) )