From b665991895e4994e1cafb8affb2b4a5517931fc8 Mon Sep 17 00:00:00 2001
From: Johannes Eiglsperger <git@remodding.de>
Date: Sun, 25 Jun 2023 11:16:38 +0200
Subject: [PATCH 1/5] Add option for minimum GOP size

---
 ffmpeg/options.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffmpeg/options.go b/ffmpeg/options.go
index 323d4b3..03225ed 100644
--- a/ffmpeg/options.go
+++ b/ffmpeg/options.go
@@ -18,6 +18,7 @@ type Options struct {
 	FrameRate             *int              `flag:"-r"`
 	AudioRate             *int              `flag:"-ar"`
 	KeyframeInterval      *int              `flag:"-g"`
+	MinimumGopSize        *int              `flag:"-keyint_min"`
 	AudioCodec            *string           `flag:"-c:a"`
 	AudioBitrate          *string           `flag:"-ab"`
 	AudioChannels         *int              `flag:"-ac"`
@@ -102,7 +103,7 @@ func (opts Options) GetStrArguments() []string {
 					values = append(values, k, fmt.Sprintf("%v", v))
 				}
 			}
-			
+
 			if vi, ok := value.(*int); ok {
 				values = append(values, flag, fmt.Sprintf("%d", *vi))
 			}

From e87b73fa01e28718dbd32796560c7b3d551f6e06 Mon Sep 17 00:00:00 2001
From: Johannes Eiglsperger <git@remodding.de>
Date: Sun, 25 Jun 2023 11:16:39 +0200
Subject: [PATCH 2/5] Add option for scene change detection threshold

---
 ffmpeg/options.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ffmpeg/options.go b/ffmpeg/options.go
index 03225ed..f93f34d 100644
--- a/ffmpeg/options.go
+++ b/ffmpeg/options.go
@@ -19,6 +19,7 @@ type Options struct {
 	AudioRate             *int              `flag:"-ar"`
 	KeyframeInterval      *int              `flag:"-g"`
 	MinimumGopSize        *int              `flag:"-keyint_min"`
+	ScThreshold           *float64          `flag:"-sc_threshold"`
 	AudioCodec            *string           `flag:"-c:a"`
 	AudioBitrate          *string           `flag:"-ab"`
 	AudioChannels         *int              `flag:"-ac"`
@@ -81,7 +82,6 @@ func (opts Options) GetStrArguments() []string {
 		value := v.Field(i).Interface()
 
 		if !v.Field(i).IsNil() {
-
 			if _, ok := value.(*bool); ok {
 				values = append(values, flag)
 			}
@@ -91,7 +91,6 @@ func (opts Options) GetStrArguments() []string {
 			}
 
 			if va, ok := value.([]string); ok {
-
 				for i := 0; i < len(va); i++ {
 					item := va[i]
 					values = append(values, flag, item)
@@ -108,6 +107,9 @@ func (opts Options) GetStrArguments() []string {
 				values = append(values, flag, fmt.Sprintf("%d", *vi))
 			}
 
+			if vf, ok := value.(*float64); ok {
+				values = append(values, flag, fmt.Sprintf("%g", *vf))
+			}
 		}
 	}
 

From 67e098a4fd44c62f0eac8b2b4fd90c11b8cfa0d9 Mon Sep 17 00:00:00 2001
From: Johannes Eiglsperger <git@remodding.de>
Date: Sun, 25 Jun 2023 11:16:39 +0200
Subject: [PATCH 3/5] Add option for HLS fMP4 init filename

---
 ffmpeg/options.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ffmpeg/options.go b/ffmpeg/options.go
index f93f34d..18616e5 100644
--- a/ffmpeg/options.go
+++ b/ffmpeg/options.go
@@ -51,6 +51,7 @@ type Options struct {
 	HlsSegmentDuration    *int              `flag:"-hls_time"`
 	HlsMasterPlaylistName *string           `flag:"-master_pl_name"`
 	HlsSegmentFilename    *string           `flag:"-hls_segment_filename"`
+	HlsFmp4InitFilename   *string           `flag:"-hls_fmp4_init_filename"`
 	HTTPMethod            *string           `flag:"-method"`
 	HTTPKeepAlive         *bool             `flag:"-multiple_requests"`
 	Hwaccel               *string           `flag:"-hwaccel"`

From cdcb23db0cafe2f9769323f6e1398219c894fb59 Mon Sep 17 00:00:00 2001
From: Johannes Eiglsperger <git@remodding.de>
Date: Sun, 25 Jun 2023 11:45:35 +0200
Subject: [PATCH 4/5] Add option for HLS segment type

---
 ffmpeg/options.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ffmpeg/options.go b/ffmpeg/options.go
index 18616e5..2a0adcb 100644
--- a/ffmpeg/options.go
+++ b/ffmpeg/options.go
@@ -50,6 +50,7 @@ type Options struct {
 	HlsListSize           *int              `flag:"-hls_list_size"`
 	HlsSegmentDuration    *int              `flag:"-hls_time"`
 	HlsMasterPlaylistName *string           `flag:"-master_pl_name"`
+	HlsSegmentType        *string           `flag:"-hls_segment_type"`
 	HlsSegmentFilename    *string           `flag:"-hls_segment_filename"`
 	HlsFmp4InitFilename   *string           `flag:"-hls_fmp4_init_filename"`
 	HTTPMethod            *string           `flag:"-method"`

From 52003804e80790941c228ea933a35b8a9d16c84d Mon Sep 17 00:00:00 2001
From: Johannes Eiglsperger <git@remodding.de>
Date: Mon, 26 Jun 2023 12:49:58 +0200
Subject: [PATCH 5/5] Add option for HLS flags

---
 ffmpeg/options.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ffmpeg/options.go b/ffmpeg/options.go
index 2a0adcb..66e6aa1 100644
--- a/ffmpeg/options.go
+++ b/ffmpeg/options.go
@@ -53,6 +53,7 @@ type Options struct {
 	HlsSegmentType        *string           `flag:"-hls_segment_type"`
 	HlsSegmentFilename    *string           `flag:"-hls_segment_filename"`
 	HlsFmp4InitFilename   *string           `flag:"-hls_fmp4_init_filename"`
+	HlsFlags              *string           `flag:"-hls_flags"`
 	HTTPMethod            *string           `flag:"-method"`
 	HTTPKeepAlive         *bool             `flag:"-multiple_requests"`
 	Hwaccel               *string           `flag:"-hwaccel"`