From 6378a36d91eeb10f98713bee5950e99f1b185579 Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Sun, 13 Feb 2022 03:47:27 +0000 Subject: [PATCH] remove encoded images from memory to prevent exhaustion --- video2x/encoder.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video2x/encoder.py b/video2x/encoder.py index 925569f..ce7efa7 100755 --- a/video2x/encoder.py +++ b/video2x/encoder.py @@ -133,8 +133,12 @@ class VideoEncoder(threading.Thread): time.sleep(0.1) continue + # send the image to FFmpeg for encoding self.encoder.stdin.write(image.tobytes()) + # remove the image from memory + self.processed_frames[frame_index] = None + with self.processed.get_lock(): self.processed.value += 1