Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Options for min. GOP size, scene change detection, and several HLS settings #37

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions ffmpeg/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type Options struct {
FrameRate *int `flag:"-r"`
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"`
Expand Down Expand Up @@ -48,7 +50,10 @@ 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"`
HlsFlags *string `flag:"-hls_flags"`
HTTPMethod *string `flag:"-method"`
HTTPKeepAlive *bool `flag:"-multiple_requests"`
Hwaccel *string `flag:"-hwaccel"`
Expand Down Expand Up @@ -80,7 +85,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)
}
Expand All @@ -90,7 +94,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)
Expand All @@ -102,11 +105,14 @@ 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))
}

if vf, ok := value.(*float64); ok {
values = append(values, flag, fmt.Sprintf("%g", *vf))
}
}
}

Expand Down