This commit is contained in:
Santiago Grossi 2024-08-01 03:58:05 -03:00
parent 1085886f97
commit 9e3708f500
5 changed files with 10 additions and 14 deletions

View File

@ -26,7 +26,7 @@ services:
YOLO_MODELS: yolov7-320
devices:
- /dev/bus/usb:/dev/bus/usb
# - /dev/dri:/dev/dri # for intel hwaccel, needs to be updated for your hardware
#- /dev/dri:/dev/dri # for intel hwaccel, needs to be updated for your hardware
volumes:
- .:/workspace/frigate:cached
- ./web/dist:/opt/frigate/web:cached

View File

@ -30,3 +30,4 @@ ws4py == 0.5.*
unidecode == 1.3.*
onnxruntime == 1.18.*
openvino == 2024.1.*
flask-cors == 1.10.*

View File

@ -36,6 +36,8 @@ from frigate.util.builtin import (
)
from frigate.util.services import ffprobe_stream, restart_frigate, vainfo_hwaccel
from frigate.version import VERSION
from flask_cors import CORS, cross_origin
from flask_cors import CORS, cross_origin
logger = logging.getLogger(__name__)
@ -60,13 +62,7 @@ def create_app(
stats_emitter: StatsEmitter,
):
app = Flask(__name__)
@app.before_request
def check_csrf():
if request.method in ["GET", "HEAD", "OPTIONS", "TRACE"]:
pass
if "origin" in request.headers and "x-csrf-token" not in request.headers:
return jsonify({"success": False, "message": "Missing CSRF header"}), 401
CORS(app)
@app.before_request
def _db_connect():

View File

@ -548,6 +548,7 @@ def vod_ts(camera_name, start_ts, end_ts):
if 0 < duration < max_duration_ms:
clip["keyFrameDurations"] = [duration]
clip["id"] = "san"
clips.append(clip)
durations.append(duration)
else:

View File

@ -21,14 +21,12 @@ class TestConfig(unittest.TestCase):
"back": {
"ffmpeg": {
"inputs": [
{"path": "rtsp://10.0.0.1:554/video", "roles": ["detect"]}
{
"path": "rtsp://admin:12publico34@elpinarfutbol.ddns.net:554/cam/realmonitor?channel=1&subtype=0",
"roles": ["record"],
}
]
},
"detect": {
"height": 1080,
"width": 1920,
"fps": 5,
},
}
},
}