Undo DASH change

This commit is contained in:
Nick Mowen 2022-12-15 06:55:21 -07:00
parent 4ef3a7282a
commit a3623290ff
8 changed files with 29 additions and 28 deletions

View File

@ -126,8 +126,8 @@ RUN wget -qO edgetpu_model.tflite https://github.com/google-coral/test_data/raw/
RUN wget -qO cpu_model.tflite https://github.com/google-coral/test_data/raw/release-frogfish/ssdlite_mobiledet_coco_qat_postprocess.tflite
COPY labelmap.txt .
# Copy OpenVino model
COPY --from=ov-converter /models/public/ssdlite_mobilenet_v2/FP16 openvino-model
RUN wget -q https://github.com/openvinotoolkit/open_model_zoo/raw/master/data/dataset_classes/coco_91cl_bkgr.txt -O openvino-model/coco_91cl_bkgr.txt
#COPY --from=ov-converter /models/public/ssdlite_mobilenet_v2/FP16 openvino-model
#RUN wget -q https://github.com/openvinotoolkit/open_model_zoo/raw/master/data/dataset_classes/coco_91cl_bkgr.txt -O openvino-model/coco_91cl_bkgr.txt

View File

@ -12,8 +12,8 @@ services:
build:
context: .
target: devcontainer
devices:
- /dev/bus/usb:/dev/bus/usb
# devices:
# - /dev/bus/usb:/dev/bus/usb
# - /dev/dri:/dev/dri # for intel hwaccel, needs to be updated for your hardware
volumes:
- .:/workspace/frigate:cached
@ -21,7 +21,7 @@ services:
- /etc/localtime:/etc/localtime:ro
- ./config/config.yml:/config/config.yml:ro
- ./debug:/media/frigate
- /dev/bus/usb:/dev/bus/usb
# - /dev/bus/usb:/dev/bus/usb
mqtt:
container_name: mqtt
image: eclipse-mosquitto:1.6

View File

@ -61,12 +61,12 @@ http {
vod_mode mapped;
vod_max_mapping_response_size 1m;
vod_upstream_location /api;
vod_ignore_edit_list on;
vod_segment_duration 4000;
vod_align_segments_to_key_frames on;
vod_manifest_duration_policy min;
vod_dash_manifest_format segmenttemplate;
vod_dash_profiles urn:mpeg:dash:profile:isoff-live:2011;
vod_manifest_segment_durations_mode accurate;
vod_ignore_edit_list on;
vod_segment_duration 10000;
vod_hls_mpegts_align_frames off;
vod_hls_mpegts_interleave_frame on;
# file handle caching / aio
open_file_cache max=1000 inactive=5m;
@ -84,14 +84,14 @@ http {
# gzip manifests
gzip on;
gzip_types application/vnd.apple.mpegurl video/f4m application/dash+xml text/xml;
gzip_types application/vnd.apple.mpegurl;
location /vod/ {
aio threads;
vod dash;
vod hls;
secure_token $args;
secure_token_types application/dash+xml;
secure_token_types application/vnd.apple.mpegurl;
add_header Access-Control-Allow-Headers '*';
add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
@ -101,11 +101,6 @@ http {
expires off;
}
location /vod_status {
vod_status;
access_log off;
}
location /stream/ {
add_header Cache-Control "no-store";
expires off;

View File

@ -5,6 +5,7 @@ CACHE_DIR = "/tmp/cache"
YAML_EXT = (".yaml", ".yml")
PLUS_ENV_VAR = "PLUS_API_KEY"
PLUS_API_HOST = "https://api.frigate.video"
MAX_SEGMENT_DURATION = 600
# Regex Consts

View File

@ -32,7 +32,7 @@ from peewee import SqliteDatabase, operator, fn, DoesNotExist
from playhouse.shortcuts import model_to_dict
from frigate.config import FrigateConfig
from frigate.const import CLIPS_DIR, RECORD_DIR
from frigate.const import CLIPS_DIR, MAX_SEGMENT_DURATION, RECORD_DIR
from frigate.models import Event, Recordings
from frigate.object_processing import TrackedObject
from frigate.stats import stats_snapshot
@ -1050,13 +1050,19 @@ def vod_ts(camera_name, start_ts, end_ts):
clips = []
durations = []
max_duration_ms = MAX_SEGMENT_DURATION * 1000
recording: Recordings
for recording in recordings:
clip = {"type": "source", "path": recording.path}
duration = int(recording.duration * 1000)
if duration > 0:
# Determine if we need to end the last clip early
if recording.end_time > end_ts:
duration -= int((recording.end_time - end_ts) * 1000)
if 0 < duration < max_duration_ms:
clip["keyFrameDurations"] = [duration]
clips.append(clip)
durations.append(duration)
else:

View File

@ -5,7 +5,6 @@ import multiprocessing as mp
import os
import queue
import random
import shutil
import string
import subprocess as sp
import threading
@ -16,7 +15,7 @@ import psutil
from peewee import JOIN, DoesNotExist
from frigate.config import RetainModeEnum, FrigateConfig
from frigate.const import CACHE_DIR, RECORD_DIR
from frigate.const import CACHE_DIR, MAX_SEGMENT_DURATION, RECORD_DIR
from frigate.models import Event, Recordings
from frigate.util import area
@ -173,7 +172,7 @@ class RecordingMaintainer(threading.Thread):
duration = -1
# ensure duration is within expected length
if 0 < duration < 600:
if 0 < duration < MAX_SEGMENT_DURATION:
end_time = start_time + datetime.timedelta(seconds=duration)
self.end_time_cache[cache_path] = (end_time, duration)
else:

View File

@ -561,8 +561,8 @@ export default function Events({ path, ...props }) {
autoplay: true,
sources: [
{
src: `${apiHost}/vod/event/${event.id}/manifest.mpd`,
type: 'application/dash+xml',
src: `${apiHost}vod/event/${event.id}/master.m3u8`,
type: 'application/vnd.apple.mpegurl',
},
],
}}

View File

@ -69,11 +69,11 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
description: `${camera} recording @ ${h.hour}:00.`,
sources: [
{
src: `${apiHost}/vod/${year}-${month}/${day}/${h.hour}/${camera}/${timezone.replaceAll(
src: `${apiHost}vod/${year}-${month}/${day}/${h.hour}/${camera}/${timezone.replaceAll(
'/',
'_'
)}/manifest.mpd`,
type: 'application/dash+xml',
)}/master.m3u8`,
type: 'application/vnd.apple.mpegurl',
},
],
};