diff --git a/src/api/v1/README.md b/src/api/v1/README.md index 0e34f4e..2d48274 100644 --- a/src/api/v1/README.md +++ b/src/api/v1/README.md @@ -11,10 +11,11 @@ python3.11 -m venv venv ``` From here, you can source your venv with the following commands. -Windows, probably: + +Windows: ``` -./venv/bin/Activate.ps1 +.\venv\Scripts\Activate.ps1 ``` Linux: diff --git a/src/api/v1/api.py b/src/api/v1/api.py index 43250c8..ee45117 100644 --- a/src/api/v1/api.py +++ b/src/api/v1/api.py @@ -6,7 +6,7 @@ import cv2 app = FastAPI() -camera = cv2.VideoCapture(0, cv2.CAP_DSHOW) +camera = cv2.VideoCapture(1, cv2.CAP_DSHOW) templates = Jinja2Templates(directory="templates") @@ -32,6 +32,6 @@ async def get_stream(websocket: WebSocket): else: ret, buffer = cv2.imencode(".jpg", frame) await websocket.send_bytes(buffer.tobytes()) - await asyncio.sleep(0.03) + await asyncio.sleep(0.01) except (WebSocketDisconnect, ConnectionClosed): print("Client disconnected") diff --git a/src/api/v1/requirements.txt b/src/api/v1/requirements.txt index 430616e..e426d82 100644 --- a/src/api/v1/requirements.txt +++ b/src/api/v1/requirements.txt @@ -17,6 +17,6 @@ sniffio==1.3.1 starlette==0.36.3 typing_extensions==4.10.0 uvicorn==0.29.0 -uvloop==0.19.0 +# uvloop==0.19.0 watchfiles==0.21.0 websockets==12.0