From 0f2cff507852fb4c407e656d8df2ded7b357350b Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 3 Oct 2024 07:33:06 -0600 Subject: [PATCH] Fix mjpeg api (#14138) --- frigate/api/media.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/api/media.py b/frigate/api/media.py index 8cf04763c..5915875ab 100644 --- a/frigate/api/media.py +++ b/frigate/api/media.py @@ -14,7 +14,7 @@ import numpy as np import pytz from fastapi import APIRouter, Path, Query, Request, Response from fastapi.params import Depends -from fastapi.responses import FileResponse, JSONResponse +from fastapi.responses import FileResponse, JSONResponse, StreamingResponse from pathvalidate import sanitize_filename from peewee import DoesNotExist, fn from tzlocal import get_localzone_name @@ -44,7 +44,7 @@ logger = logging.getLogger(__name__) router = APIRouter(tags=[Tags.media]) -@router.get("{camera_name}") +@router.get("/{camera_name}") def mjpeg_feed( request: Request, camera_name: str, @@ -60,7 +60,7 @@ def mjpeg_feed( } if camera_name in request.app.frigate_config.cameras: # return a multipart response - return Response( + return StreamingResponse( imagestream( request.app.detected_frames_processor, camera_name,