This commit is contained in:
		
							
								
								
									
										13
									
								
								camdetect.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								camdetect.py
									
									
									
									
									
								
							| @@ -116,7 +116,6 @@ gauge_queue_frames.labels("hold").set(0) | ||||
| gauge_queue_frames.labels("upload").set(0) | ||||
| counter_frames.labels("motion").inc(0) | ||||
|  | ||||
|  | ||||
| assert SLIDE_WINDOW <= 8  # This is 256 frames which should be enough | ||||
|  | ||||
|  | ||||
| @@ -273,9 +272,7 @@ async def motion_detector(reference_frame, download_queue, upload_queue): | ||||
|                     "screenshots": [], | ||||
|                     "action": "event", | ||||
|                 } | ||||
|                 }, | ||||
|                 upsert = True, | ||||
|                 return_document=ReturnDocument.AFTER) | ||||
|             }, upsert=True, return_document=ReturnDocument.AFTER) | ||||
|             app.ctx.event_id = event_id = result["_id"] | ||||
|  | ||||
|         # Handle buffering frames prior event start | ||||
| @@ -375,7 +372,7 @@ async def download(resp, queue): | ||||
|                 continue | ||||
|             else: | ||||
|                 # Assemble JPEG blob | ||||
|                 blob = buf + data[:marker+2] | ||||
|                 blob = buf + data[:marker + 2] | ||||
|  | ||||
|                 # Parse DCT coefficients | ||||
|                 try: | ||||
| @@ -394,7 +391,7 @@ async def download(resp, queue): | ||||
|                     except asyncio.QueueFull: | ||||
|                         counter_dropped_frames.labels("download").inc() | ||||
|                     gauge_queue_frames.labels("download").set(queue.qsize()) | ||||
|                 data = data[marker+2:] | ||||
|                 data = data[marker + 2:] | ||||
|                 buf = b"" | ||||
|                 counter_receive_frames.inc() | ||||
|  | ||||
| @@ -467,8 +464,8 @@ async def stream_wrapper(request): | ||||
|                 for y in range(0, app.ctx.mask.shape[0]): | ||||
|                     for x in range(0, app.ctx.mask.shape[1]): | ||||
|                         if app.ctx.mask[y][x] > 0: | ||||
|                             img[y*DCT_BLOCK_SIZE:(y+1)*DCT_BLOCK_SIZE, | ||||
|                                 x*DCT_BLOCK_SIZE:(x+1)*DCT_BLOCK_SIZE, | ||||
|                             img[y * DCT_BLOCK_SIZE:(y + 1) * DCT_BLOCK_SIZE, | ||||
|                                 x * DCT_BLOCK_SIZE:(x + 1) * DCT_BLOCK_SIZE, | ||||
|                                 channel] = 255 | ||||
|  | ||||
|             # Compress modified frame as JPEG frame | ||||
|   | ||||
		Reference in New Issue
	
	Block a user