fixed issue with vaapi and amf encoders

This commit is contained in:
John Andrews
2022-06-11 20:39:44 +12:00
parent 958167ce2a
commit 458bdb37c6
3 changed files with 28 additions and 2 deletions

View File

@@ -195,7 +195,7 @@ public class FfmpegBuilderVideoEncode:FfmpegBuilderNode
stream.EncodingParameters.Clear();
stream.EncodingParameters.AddRange(new[]
{
h265 ? "amf_nvenc" : "amf_nvenc",
h265 ? "hevc_amf" : "h264_amf",
"-rc", "constqp",
"-qp", Quality.ToString(),
//"-b:v", "0K", // this would do a two-pass... slower
@@ -212,7 +212,7 @@ public class FfmpegBuilderVideoEncode:FfmpegBuilderNode
stream.EncodingParameters.Clear();
stream.EncodingParameters.AddRange(new[]
{
h265 ? "amf_nvenc" : "amf_nvenc",
h265 ? "hevc_vaapi" : "h264_vaapi",
"-rc", "constqp",
"-qp", Quality.ToString(),
//"-b:v", "0K", // this would do a two-pass... slower

View File

@@ -160,6 +160,31 @@ public class VideoHasStreamTests : TestBase
Assert.AreEqual(2, output);
}
[TestMethod]
public void VideoHasStream_Video_Tag()
{
string file = TestFile_Tag;
var vi = new VideoInfoHelper(FfmpegPath, new TestLogger());
var vii = vi.Read(file);
VideoHasStream node = new();
node.Codec = "h264";
node.Stream = "Video";
var args = new NodeParameters(file, new TestLogger(), false, string.Empty);
args.GetToolPathActual = (string tool) => FfmpegPath;
args.TempPath = TempPath;
var vf = new VideoFile();
vf.PreExecute(args);
Assert.AreEqual(1, vf.Execute(args));
int output = node.Execute(args);
Assert.AreEqual(1, output);
}
}

View File

@@ -50,6 +50,7 @@ public abstract class TestBase
}
protected string TestFile_BasicMkv => Path.Combine(TestPath, "basic.mkv");
protected string TestFile_Tag => Path.Combine(TestPath, "tag.mp4");
protected string TestFile_Pgs => Path.Combine(TestPath, "pgs.mkv");
protected string TestFile_TwoPassNegInifinity => Path.Combine(TestPath, "audio_normal_neg_infinity.mkv");
protected string TestFile_4k_h264mov => Path.Combine(TestPath, "4k_h264.mov");