Tweak video bandwidth values to be < 10% over max

This commit is contained in:
Gabe Kangas
2021-10-31 23:00:11 -07:00
parent aeaf886855
commit 5b38426e31
2 changed files with 31 additions and 19 deletions

View File

@ -67,11 +67,9 @@ func (c *Libx264Codec) ExtraFilters() string {
// VariantFlags returns a string representing a single variant processed by this codec.
func (c *Libx264Codec) VariantFlags(v *HLSVariant) string {
bufferSize := int(float64(v.videoBitrate) * 1.2) // How often it checks the bitrate of encoded segments to see if it's too high/low.
return strings.Join([]string{
fmt.Sprintf("-x264-params:v:%d \"scenecut=0:open_gop=0\"", v.index), // How often the encoder checks the bitrate in order to meet average/max values
fmt.Sprintf("-bufsize:v:%d %dk", v.index, bufferSize),
fmt.Sprintf("-bufsize:v:%d %dk", v.index, v.getBufferSize()),
fmt.Sprintf("-profile:v:%d %s", v.index, "high"), // Encoding profile
}, " ")
}