mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	check to see if we have a frame before trying to send
This commit is contained in:
		
							parent
							
								
									d90e408d50
								
							
						
					
					
						commit
						ab3e70b4db
					
				@ -33,8 +33,8 @@ class MqttObjectPublisher(threading.Thread):
 | 
				
			|||||||
                if new_status != current_object_status[obj_name]:
 | 
					                if new_status != current_object_status[obj_name]:
 | 
				
			||||||
                    current_object_status[obj_name] = new_status
 | 
					                    current_object_status[obj_name] = new_status
 | 
				
			||||||
                    self.client.publish(self.topic_prefix+'/'+obj_name, new_status, retain=False)
 | 
					                    self.client.publish(self.topic_prefix+'/'+obj_name, new_status, retain=False)
 | 
				
			||||||
                    # send the snapshot over mqtt as well
 | 
					                    # send the snapshot over mqtt if we have it as well
 | 
				
			||||||
                    if not self.best_frames.best_frames[obj_name] is None:
 | 
					                    if obj_name in self.best_frames.best_frames:
 | 
				
			||||||
                        ret, jpg = cv2.imencode('.jpg', self.best_frames.best_frames[obj_name])
 | 
					                        ret, jpg = cv2.imencode('.jpg', self.best_frames.best_frames[obj_name])
 | 
				
			||||||
                        if ret:
 | 
					                        if ret:
 | 
				
			||||||
                            jpg_bytes = jpg.tobytes()
 | 
					                            jpg_bytes = jpg.tobytes()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user