mirror of
				https://github.com/k4yt3x/video2x.git
				synced 2025-11-04 06:31:00 +01:00 
			
		
		
		
	remove encoded images from memory to prevent exhaustion
This commit is contained in:
		
							parent
							
								
									0d0fd70a24
								
							
						
					
					
						commit
						6378a36d91
					
				@ -133,8 +133,12 @@ class VideoEncoder(threading.Thread):
 | 
				
			|||||||
                    time.sleep(0.1)
 | 
					                    time.sleep(0.1)
 | 
				
			||||||
                    continue
 | 
					                    continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                # send the image to FFmpeg for encoding
 | 
				
			||||||
                self.encoder.stdin.write(image.tobytes())
 | 
					                self.encoder.stdin.write(image.tobytes())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                # remove the image from memory
 | 
				
			||||||
 | 
					                self.processed_frames[frame_index] = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                with self.processed.get_lock():
 | 
					                with self.processed.get_lock():
 | 
				
			||||||
                    self.processed.value += 1
 | 
					                    self.processed.value += 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user