Skip to content

Commit

Permalink
remove encoded images from memory to prevent exhaustion
Browse files Browse the repository at this point in the history
  • Loading branch information
k4yt3x committed Feb 13, 2022
1 parent 0d0fd70 commit 6378a36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions video2x/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ def run(self):
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

Expand Down

0 comments on commit 6378a36

Please sign in to comment.