Add configurable minimum MP4 fragment duration and Matroska cluster duration

This commit is contained in:
Vanilagy
2025-03-22 15:33:00 +01:00
parent 1652b4f614
commit b14daf6dca
6 changed files with 38 additions and 22 deletions
+1 -1
View File
@@ -703,7 +703,7 @@ export class MatroskaMuxer extends Muxer {
// CURRENT chunk, meaning that starting the next cluster at the same timestamp is forbidden (since
// the already-written block would belong into it instead).
&& msTimestamp > this.currentClusterMaxMsTimestamp
&& relativeTimestamp >= 1000
&& relativeTimestamp >= 1000 * (this.format._options.minimumClusterDuration ?? 1)
)
// The cluster would exceed its maximum allowed length. This puts us in an unfortunate position and forces
// us to begin the next cluster with a delta frame. Although this is undesirable, it is not forbidden by the