mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 09:04:28 +03:00
Merge branch 'blakeblackshear:dev' into 0.16-fixed-Jan-synced
This commit is contained in:
commit
197ee4158a
@ -7,7 +7,7 @@ title: Configuring go2rtc
|
|||||||
|
|
||||||
Use of the bundled go2rtc is optional. You can still configure FFmpeg to connect directly to your cameras. However, adding go2rtc to your configuration is required for the following features:
|
Use of the bundled go2rtc is optional. You can still configure FFmpeg to connect directly to your cameras. However, adding go2rtc to your configuration is required for the following features:
|
||||||
|
|
||||||
- WebRTC or MSE for live viewing with higher resolutions and frame rates than the jsmpeg stream which is limited to the detect stream
|
- WebRTC or MSE for live viewing with audio, higher resolutions and frame rates than the jsmpeg stream which is limited to the detect stream and does not support audio
|
||||||
- Live stream support for cameras in Home Assistant Integration
|
- Live stream support for cameras in Home Assistant Integration
|
||||||
- RTSP relay for use with other consumers to reduce the number of connections to your camera streams
|
- RTSP relay for use with other consumers to reduce the number of connections to your camera streams
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,10 @@ ffmpeg:
|
|||||||
record: preset-record-generic-audio-aac
|
record: preset-record-generic-audio-aac
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### How can I get sound in live view?
|
||||||
|
|
||||||
|
Audio is only supported for live view when go2rtc is configured, see [the live docs](../configuration/live.md) for more information.
|
||||||
|
|
||||||
### I can't view recordings in the Web UI.
|
### I can't view recordings in the Web UI.
|
||||||
|
|
||||||
Ensure your cameras send h264 encoded video, or [transcode them](/configuration/restream.md).
|
Ensure your cameras send h264 encoded video, or [transcode them](/configuration/restream.md).
|
||||||
|
|||||||
@ -35,14 +35,13 @@ from frigate.storage import StorageMaintainer
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def check_csrf(request: Request):
|
def check_csrf(request: Request) -> bool:
|
||||||
if request.method in ["GET", "HEAD", "OPTIONS", "TRACE"]:
|
if request.method in ["GET", "HEAD", "OPTIONS", "TRACE"]:
|
||||||
pass
|
return True
|
||||||
if "origin" in request.headers and "x-csrf-token" not in request.headers:
|
if "origin" in request.headers and "x-csrf-token" not in request.headers:
|
||||||
return JSONResponse(
|
return False
|
||||||
content={"success": False, "message": "Missing CSRF header"},
|
|
||||||
status_code=401,
|
return True
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# Used to retrieve the remote-user header: https://starlette-context.readthedocs.io/en/latest/plugins.html#easy-mode
|
# Used to retrieve the remote-user header: https://starlette-context.readthedocs.io/en/latest/plugins.html#easy-mode
|
||||||
@ -80,7 +79,12 @@ def create_fastapi_app(
|
|||||||
@app.middleware("http")
|
@app.middleware("http")
|
||||||
async def frigate_middleware(request: Request, call_next):
|
async def frigate_middleware(request: Request, call_next):
|
||||||
# Before request
|
# Before request
|
||||||
check_csrf(request)
|
if not check_csrf(request):
|
||||||
|
return JSONResponse(
|
||||||
|
content={"success": False, "message": "Missing CSRF header"},
|
||||||
|
status_code=401,
|
||||||
|
)
|
||||||
|
|
||||||
if database.is_closed():
|
if database.is_closed():
|
||||||
database.connect()
|
database.connect()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user