remove encoded images from memory to prevent exhaustion

This commit is contained in:
k4yt3x 2022-02-13 03:47:27 +00:00
parent 0d0fd70a24
commit 6378a36d91

View File

@ -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