From 7a5aab6964d183ea05cddbe58640a0796af51dc2 Mon Sep 17 00:00:00 2001 From: ZZX9599 <536509593@qq.com> Date: Tue, 2 Sep 2025 19:54:06 +0800 Subject: [PATCH] =?UTF-8?q?RTC=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtc/rtc.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rtc/rtc.py b/rtc/rtc.py index a6fadcc..01bf1d7 100644 --- a/rtc/rtc.py +++ b/rtc/rtc.py @@ -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}、进行处理") # 标记任务完成