RTC提交
This commit is contained in:
		| @ -2,6 +2,7 @@ import asyncio | ||||
| import aiohttp | ||||
| from aiortc import RTCPeerConnection, RTCSessionDescription, RTCConfiguration | ||||
| from aiortc.mediastreams import MediaStreamTrack | ||||
| from ocr.ocr_violation_detector import detect | ||||
|  | ||||
|  | ||||
| class VideoTrack(MediaStreamTrack): | ||||
| @ -88,6 +89,10 @@ async def frame_consumer(frame_queue): | ||||
|     while True: | ||||
|         # 从队列中获取帧(队列为空时会阻塞等待新帧) | ||||
|         current_frame = await frame_queue.get() | ||||
|  | ||||
|         # 检测 | ||||
|         detect(current_frame) | ||||
|  | ||||
|         print(f"从队列获取到帧、尺寸: {current_frame.shape}、进行处理") | ||||
|  | ||||
|         # 标记任务完成 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 ZZX9599
					ZZX9599