Add support hardware resize for Rockchip

This commit is contained in:
Alex X
2023-12-05 17:04:17 +03:00
parent d0dfa1d3dd
commit a46bad0522
3 changed files with 17 additions and 2 deletions
+15
View File
@@ -129,6 +129,21 @@ func MakeHardware(args *ffmpeg.Args, engine string, defaults map[string]string)
case EngineRKMPP:
args.Codecs[i] = defaults[name+"/"+engine]
for j, filter := range args.Filters {
if strings.HasPrefix(filter, "scale=") {
args.Filters = append(args.Filters[:j], args.Filters[j+1:]...)
width, height, _ := strings.Cut(filter[6:], ":")
if width != "-1" {
args.Codecs[i] += " -width " + width
}
if height != "-1" {
args.Codecs[i] += " -height " + height
}
break
}
}
}
}
}