wip: Add quicksync support

This commit is contained in:
Zoe Roux
2024-02-25 02:08:37 +01:00
parent c1cdcddf41
commit 25fc5d5835
5 changed files with 42 additions and 2 deletions
+14 -1
View File
@@ -17,7 +17,7 @@ func DetectHardwareAccel() HwAccelT {
EncodeFlags: []string{
"-c:v", "libx264",
// superfast or ultrafast would produce a file extremly big so we prever veryfast or faster.
"-preset", "faster",
"-preset", "fast",
// sc_threshold is a scene detection mechanisum used to create a keyframe when the scene changes
// this is on by default and inserts keyframes where we don't want to (it also breaks force_key_frames)
// we disable it to prevents whole scenes from behing removed due to the -f segment failing to find the corresonding keyframe
@@ -64,6 +64,19 @@ func DetectHardwareAccel() HwAccelT {
},
ScaleFilter: "scale_vaapi=%d:%d",
}
case "qsv", "intel":
return HwAccelT{
Name: name,
DecodeFlags: []string{
"-hwaccel", "qsv",
"-hwaccel_output_format", "qsv",
},
EncodeFlags: []string{
"-c:v", "h264_qsv",
"-preset", "fast",
},
ScaleFilter: "scale_qsv=%d:%d",
}
default:
log.Printf("No hardware accelerator named: %s", name)
os.Exit(2)