Added codec-aware encoding profiles and moved pixel format to per-variant output.

Encoders now receive the codec being used, allowing them to adjust their flags accordingly. For example, the software encoder gates x264-specific parameters behind a codec check so that future encoders like libx265 or libsvtav1 can provide their own flags without conflict. Pixel format is now specified per variant with a stream specifier rather than globally, enabling codecs like AV1 to use 10-bit color for improved compression efficiency while H.264 variants continue using yuv420p.
This commit is contained in:
2026-04-04 14:50:29 -04:00
parent 50e14adac2
commit 46b9c8bd2e
14 changed files with 90 additions and 109 deletions
+6 -12
View File
@@ -23,22 +23,16 @@ func (e *NvencEncoder) GlobalFlags() []string {
}
}
func (e *NvencEncoder) PixelFormat() string {
return pixelFormatYUV420P
}
func (e *NvencEncoder) Scaler() string {
return ""
}
func (e *NvencEncoder) ExtraFilters() string {
return ""
}
func (e *NvencEncoder) ExtraArguments() []string {
return nil
}
func (e *NvencEncoder) ProfileForCodec(codec string) CodecProfile {
return CodecProfile{
PixelFormat: pixelFormatYUV420P,
}
}
func (e *NvencEncoder) VariantFlags(v *HLSVariant) []string {
return []string{
fmt.Sprintf("-tune:v:%d", v.index), "ll",