From eff6d59f4178af186cdaff914838a450895964c6 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Wed, 17 Apr 2024 23:51:58 +0200 Subject: [PATCH] record: increase default part duration to 1s --- internal/conf/conf_test.go | 2 +- internal/conf/path.go | 2 +- mediamtx.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/conf/conf_test.go b/internal/conf/conf_test.go index 38ba2d67a46..669415b5ad6 100644 --- a/internal/conf/conf_test.go +++ b/internal/conf/conf_test.go @@ -54,7 +54,7 @@ func TestConfFromFile(t *testing.T) { SourceOnDemandCloseAfter: 10 * StringDuration(time.Second), RecordPath: "./recordings/%path/%Y-%m-%d_%H-%M-%S-%f", RecordFormat: RecordFormatFMP4, - RecordPartDuration: 100000000, + RecordPartDuration: StringDuration(1 * time.Second), RecordSegmentDuration: 3600000000000, RecordDeleteAfter: 86400000000000, OverridePublisher: true, diff --git a/internal/conf/path.go b/internal/conf/path.go index 2bfdfde8cd6..5722a21fe72 100644 --- a/internal/conf/path.go +++ b/internal/conf/path.go @@ -190,7 +190,7 @@ func (pconf *Path) setDefaults() { // Record pconf.RecordPath = "./recordings/%path/%Y-%m-%d_%H-%M-%S-%f" pconf.RecordFormat = RecordFormatFMP4 - pconf.RecordPartDuration = 100 * StringDuration(time.Millisecond) + pconf.RecordPartDuration = StringDuration(1 * time.Second) pconf.RecordSegmentDuration = 3600 * StringDuration(time.Second) pconf.RecordDeleteAfter = 24 * 3600 * StringDuration(time.Second) diff --git a/mediamtx.yml b/mediamtx.yml index 466e70d5265..94d63d402a6 100644 --- a/mediamtx.yml +++ b/mediamtx.yml @@ -387,7 +387,7 @@ pathDefaults: # MPEG-TS segments are concatenation of 188-bytes packets, flushed to disk with this period. # When a system failure occurs, the last part gets lost. # Therefore, the part duration is equal to the RPO (recovery point objective). - recordPartDuration: 100ms + recordPartDuration: 1s # Minimum duration of each segment. recordSegmentDuration: 1h # Delete segments after this timespan.