From e85d2d44161fb7ebc69efe96d688015c45bcb67b Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 1 Jul 2024 08:08:48 +0000 Subject: [PATCH] Try custom fmp4 movflags It seems presentation time and durations are not consistent with previous segments so the hls renderer can't keep up --- shell.nix | 1 + transcoder/src/stream.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 62457365..dd40db9c 100644 --- a/shell.nix +++ b/shell.nix @@ -32,6 +32,7 @@ in go wgo mediainfo + bento4 ffmpeg-full postgresql_15 pgformatter diff --git a/transcoder/src/stream.go b/transcoder/src/stream.go index d5545839..d0d23572 100644 --- a/transcoder/src/stream.go +++ b/transcoder/src/stream.go @@ -251,7 +251,7 @@ func (ts *Stream) run(start int32) error { // when segments are short (can make the video repeat itself) "-segment_time_delta", "0.05", "-segment_format", "mp4", - "-segment_format_options", "movflags=dash", + "-segment_format_options", "movflags=frag_keyframe+empty_moov+omit_tfhd_offset+faststart", "-segment_times", toSegmentStr(Map(segments, func(seg float64, _ int) float64 { // segment_times want durations, not timestamps so we must subtract the -ss param // since we give a greater value to -ss to prevent wrong seeks but -segment_times