mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Use DASH instead of hls
This commit is contained in:
parent
b36266e2b2
commit
edcb1b554b
@ -62,11 +62,18 @@ http {
|
||||
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 performance https://github.com/kaltura/nginx-vod-module#performance-recommendations
|
||||
vod_hls_mpegts_align_frames off;
|
||||
vod_hls_mpegts_interleave_frames on;
|
||||
aio on;
|
||||
# file handle caching / aio
|
||||
open_file_cache max=1000 inactive=5m;
|
||||
open_file_cache_valid 2m;
|
||||
open_file_cache_min_uses 1;
|
||||
open_file_cache_errors on;
|
||||
aio on;
|
||||
|
||||
# https://github.com/kaltura/nginx-vod-module#vod_open_file_thread_pool
|
||||
vod_open_file_thread_pool default;
|
||||
@ -77,14 +84,14 @@ http {
|
||||
|
||||
# gzip manifests
|
||||
gzip on;
|
||||
gzip_types application/vnd.apple.mpegurl;
|
||||
gzip_types application/vnd.apple.mpegurl video/f4m application/dash+xml text/xml;
|
||||
|
||||
location /vod/ {
|
||||
aio threads;
|
||||
vod hls;
|
||||
vod dash;
|
||||
|
||||
secure_token $args;
|
||||
secure_token_types application/vnd.apple.mpegurl;
|
||||
secure_token_types application/dash+xml;
|
||||
|
||||
add_header Access-Control-Allow-Headers '*';
|
||||
add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
|
||||
|
||||
@ -1056,12 +1056,7 @@ def vod_ts(camera_name, start_ts, end_ts):
|
||||
clip = {"type": "source", "path": recording.path}
|
||||
duration = int(recording.duration * 1000)
|
||||
|
||||
# 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 duration > 0:
|
||||
clip["keyFrameDurations"] = [duration]
|
||||
clips.append(clip)
|
||||
durations.append(duration)
|
||||
else:
|
||||
@ -1076,6 +1071,7 @@ def vod_ts(camera_name, start_ts, end_ts):
|
||||
{
|
||||
"cache": hour_ago.timestamp() > start_ts,
|
||||
"discontinuity": False,
|
||||
"consistentSequenceMediaInfo": True,
|
||||
"durations": durations,
|
||||
"segment_duration": max(durations),
|
||||
"sequences": [{"clips": clips}],
|
||||
|
||||
@ -561,8 +561,8 @@ export default function Events({ path, ...props }) {
|
||||
autoplay: true,
|
||||
sources: [
|
||||
{
|
||||
src: `${apiHost}/vod/event/${event.id}/master.m3u8`,
|
||||
type: 'application/vnd.apple.mpegurl',
|
||||
src: `${apiHost}/vod/event/${event.id}/manifest.mpd`,
|
||||
type: 'application/dash+xml',
|
||||
},
|
||||
],
|
||||
}}
|
||||
|
||||
@ -72,8 +72,8 @@ export default function Recording({ camera, date, hour = '00', minute = '00', se
|
||||
src: `${apiHost}/vod/${year}-${month}/${day}/${h.hour}/${camera}/${timezone.replaceAll(
|
||||
'/',
|
||||
'_'
|
||||
)}/master.m3u8`,
|
||||
type: 'application/vnd.apple.mpegurl',
|
||||
)}/manifest.mpd`,
|
||||
type: 'application/dash+xml',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user