Update machinery/src/video/mp4.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Cédric Verstraeten
2026-02-10 17:20:40 +01:00
committed by GitHub
parent 5d745fc989
commit 32b471f570

View File

@@ -80,7 +80,7 @@ func NewMP4(fileName string, spsNALUs [][]byte, ppsNALUs [][]byte, vpsNALUs [][]
// Segments are ~FragmentDurationMs each, so:
// numSegments = ceil(maxDurationSec * 1000 / FragmentDurationMs) + 1 (safety margin)
// sidxSize = 24 + 12 * numSegments
baseSize := int64(2048) // ftyp + moov + headroom
baseSize := int64(2560) // ftyp + moov + extra headroom for large UUID signatures
numSegments := int64(0)
if maxDurationSec > 0 {
// Use integer ceiling division to avoid underestimating the number of segments.