From 9a67eb8bb69f129681d028e483b6ddabf447d62e Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Thu, 18 Apr 2024 00:11:28 +0200 Subject: [PATCH] record: increase default part duration to 1s (#3264) --- 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 38ba2d67..669415b5 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 2bfdfde8..5722a21f 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 466e70d5..94d63d40 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.