From 970d61328549bae88fd1bbdb58e10f2c18617d86 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 12 Feb 2024 17:27:30 +0100 Subject: [PATCH] Disable scene detection auto keyframes as they create weird segments in transcode --- transcoder/src/videostream.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/transcoder/src/videostream.go b/transcoder/src/videostream.go index 2c1f8a96..793c4900 100644 --- a/transcoder/src/videostream.go +++ b/transcoder/src/videostream.go @@ -43,6 +43,10 @@ func (vs *VideoStream) getTranscodeArgs(segments string) []string { "-maxrate", fmt.Sprint(vs.quality.MaxBitrate()), // Force segments to be split exactly on keyframes (only works when transcoding) "-force_key_frames", segments, + // sc_threshold is a scene detection mechanisum used to create a keyframe when the scene changes + // this is on by default and inserts keyframes where we don't want to (it also breaks force_key_frames) + // we disable it to prevents whole scenes from behing removed due to the -f segment failing to find the corresonding keyframe + "-sc_threshold", "0", "-strict", "-2", } }