add video presets for nvenc, qsv, software h264 and hevc encoders (#1688)

* add video preset to ffmpeg profile

* add some hevc video presets
This commit is contained in:
Jason Dove
2024-04-23 14:26:30 -05:00
committed by GitHub
parent 07e7e5fe66
commit b9a7ad2f5a
30 changed files with 11347 additions and 47 deletions
+15 -7
View File
@@ -2,7 +2,7 @@
namespace ErsatzTV.FFmpeg.Encoder;
public class EncoderLibx264(Option<string> maybeVideoProfile) : EncoderBase
public class EncoderLibx264(Option<string> maybeVideoProfile, Option<string> maybeVideoPreset) : EncoderBase
{
public override string Name => "libx264";
public override StreamKind Kind => StreamKind.Video;
@@ -11,16 +11,24 @@ public class EncoderLibx264(Option<string> maybeVideoProfile) : EncoderBase
{
get
{
var result = new List<string>(base.OutputOptions);
foreach (string videoProfile in maybeVideoProfile)
{
return
[
"-c:v", Name,
"-profile:v", videoProfile.ToLowerInvariant()
];
result.Add("-profile:v");
result.Add(videoProfile.ToLowerInvariant());
}
return base.OutputOptions;
foreach (string videoPreset in maybeVideoPreset)
{
if (!string.IsNullOrWhiteSpace(videoPreset))
{
result.Add("-preset:v");
result.Add(videoPreset);
}
}
return result.ToArray();
}
}