mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix mjpeg api (#14138)
This commit is contained in:
parent
e5e196bd7f
commit
0f2cff5078
@ -14,7 +14,7 @@ import numpy as np
|
|||||||
import pytz
|
import pytz
|
||||||
from fastapi import APIRouter, Path, Query, Request, Response
|
from fastapi import APIRouter, Path, Query, Request, Response
|
||||||
from fastapi.params import Depends
|
from fastapi.params import Depends
|
||||||
from fastapi.responses import FileResponse, JSONResponse
|
from fastapi.responses import FileResponse, JSONResponse, StreamingResponse
|
||||||
from pathvalidate import sanitize_filename
|
from pathvalidate import sanitize_filename
|
||||||
from peewee import DoesNotExist, fn
|
from peewee import DoesNotExist, fn
|
||||||
from tzlocal import get_localzone_name
|
from tzlocal import get_localzone_name
|
||||||
@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
|
|||||||
router = APIRouter(tags=[Tags.media])
|
router = APIRouter(tags=[Tags.media])
|
||||||
|
|
||||||
|
|
||||||
@router.get("{camera_name}")
|
@router.get("/{camera_name}")
|
||||||
def mjpeg_feed(
|
def mjpeg_feed(
|
||||||
request: Request,
|
request: Request,
|
||||||
camera_name: str,
|
camera_name: str,
|
||||||
@ -60,7 +60,7 @@ def mjpeg_feed(
|
|||||||
}
|
}
|
||||||
if camera_name in request.app.frigate_config.cameras:
|
if camera_name in request.app.frigate_config.cameras:
|
||||||
# return a multipart response
|
# return a multipart response
|
||||||
return Response(
|
return StreamingResponse(
|
||||||
imagestream(
|
imagestream(
|
||||||
request.app.detected_frames_processor,
|
request.app.detected_frames_processor,
|
||||||
camera_name,
|
camera_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user