From bf3be6f73c9ccf02d22d7bac3c85a0343b688116 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Wed, 6 Sep 2023 15:19:19 +0200 Subject: [PATCH] Hotfix UDP stream on Windows --- facefusion/uis/components/webcam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facefusion/uis/components/webcam.py b/facefusion/uis/components/webcam.py index 0958bba..8b3bfaf 100644 --- a/facefusion/uis/components/webcam.py +++ b/facefusion/uis/components/webcam.py @@ -96,7 +96,7 @@ def process_stream_frame(temp_frame : Frame) -> Frame: def open_stream(mode : StreamMode) -> subprocess.Popen[bytes]: commands = [ '-f', 'rawvideo', '-pix_fmt', 'bgr24', '-s', '640x480', '-r', '30', '-i', '-' ] if mode == 'udp': - commands.extend([ '-b:v', '2000k', '-f', 'mpegts', 'udp://localhost:27000' ]) + commands.extend([ '-b:v', '2000k', '-f', 'mpegts', 'udp://localhost:27000?pkt_size=1316' ]) if mode == 'v4l2': device_name = os.listdir('/sys/devices/virtual/video4linux')[0] commands.extend([ '-f', 'v4l2', '/dev/' + device_name ])