|
|
|
@ -21,7 +21,6 @@ using ErsatzTV.FFmpeg.Filter.Vaapi; |
|
|
|
using ErsatzTV.FFmpeg.Format; |
|
|
|
using ErsatzTV.FFmpeg.Format; |
|
|
|
using ErsatzTV.FFmpeg.Pipeline; |
|
|
|
using ErsatzTV.FFmpeg.Pipeline; |
|
|
|
using ErsatzTV.FFmpeg.State; |
|
|
|
using ErsatzTV.FFmpeg.State; |
|
|
|
using ErsatzTV.Infrastructure.Data.Repositories; |
|
|
|
|
|
|
|
using ErsatzTV.Infrastructure.Images; |
|
|
|
using ErsatzTV.Infrastructure.Images; |
|
|
|
using ErsatzTV.Infrastructure.Runtime; |
|
|
|
using ErsatzTV.Infrastructure.Runtime; |
|
|
|
using ErsatzTV.Scanner.Core.Interfaces.Metadata; |
|
|
|
using ErsatzTV.Scanner.Core.Interfaces.Metadata; |
|
|
|
@ -164,7 +163,7 @@ public class TranscodingTests |
|
|
|
// // // av1 yuv420p10le 51
|
|
|
|
// // // av1 yuv420p10le 51
|
|
|
|
// //
|
|
|
|
// //
|
|
|
|
// new("msmpeg4v2", "yuv420p"),
|
|
|
|
// new("msmpeg4v2", "yuv420p"),
|
|
|
|
new("msmpeg4v3", "yuv420p") |
|
|
|
// new("msmpeg4v3", "yuv420p")
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// // wmv3 yuv420p 1
|
|
|
|
// // wmv3 yuv420p 1
|
|
|
|
}; |
|
|
|
}; |
|
|
|
@ -190,10 +189,10 @@ public class TranscodingTests |
|
|
|
|
|
|
|
|
|
|
|
public static HardwareAccelerationKind[] TestAccelerations = |
|
|
|
public static HardwareAccelerationKind[] TestAccelerations = |
|
|
|
{ |
|
|
|
{ |
|
|
|
// HardwareAccelerationKind.None,
|
|
|
|
HardwareAccelerationKind.None, |
|
|
|
// HardwareAccelerationKind.Nvenc,
|
|
|
|
// HardwareAccelerationKind.Nvenc,
|
|
|
|
HardwareAccelerationKind.Vaapi, |
|
|
|
HardwareAccelerationKind.Vaapi, |
|
|
|
HardwareAccelerationKind.Qsv |
|
|
|
// HardwareAccelerationKind.Qsv
|
|
|
|
// HardwareAccelerationKind.VideoToolbox,
|
|
|
|
// HardwareAccelerationKind.VideoToolbox,
|
|
|
|
// HardwareAccelerationKind.Amf
|
|
|
|
// HardwareAccelerationKind.Amf
|
|
|
|
}; |
|
|
|
}; |
|
|
|
@ -251,7 +250,7 @@ public class TranscodingTests |
|
|
|
MemoryCache, |
|
|
|
MemoryCache, |
|
|
|
LoggerFactory.CreateLogger<HardwareCapabilitiesFactory>()), |
|
|
|
LoggerFactory.CreateLogger<HardwareCapabilitiesFactory>()), |
|
|
|
LoggerFactory.CreateLogger<PipelineBuilderFactory>()), |
|
|
|
LoggerFactory.CreateLogger<PipelineBuilderFactory>()), |
|
|
|
new Mock<ConfigElementRepository>().Object, |
|
|
|
new Mock<IConfigElementRepository>().Object, |
|
|
|
LoggerFactory.CreateLogger<FFmpegLibraryProcessService>()); |
|
|
|
LoggerFactory.CreateLogger<FFmpegLibraryProcessService>()); |
|
|
|
|
|
|
|
|
|
|
|
var songVideoGenerator = new SongVideoGenerator(tempFilePool, mockImageCache.Object, service); |
|
|
|
var songVideoGenerator = new SongVideoGenerator(tempFilePool, mockImageCache.Object, service); |
|
|
|
@ -352,7 +351,7 @@ public class TranscodingTests |
|
|
|
now, |
|
|
|
now, |
|
|
|
Option<ChannelWatermark>.None, |
|
|
|
Option<ChannelWatermark>.None, |
|
|
|
GetWatermark(watermark), |
|
|
|
GetWatermark(watermark), |
|
|
|
VaapiDriver.Default, |
|
|
|
VaapiDriver.RadeonSI, |
|
|
|
"/dev/dri/renderD128", |
|
|
|
"/dev/dri/renderD128", |
|
|
|
Option<int>.None, |
|
|
|
Option<int>.None, |
|
|
|
false, |
|
|
|
false, |
|
|
|
@ -372,6 +371,7 @@ public class TranscodingTests |
|
|
|
profileBitDepth, |
|
|
|
profileBitDepth, |
|
|
|
profileVideoFormat, |
|
|
|
profileVideoFormat, |
|
|
|
profileAcceleration, |
|
|
|
profileAcceleration, |
|
|
|
|
|
|
|
VaapiDriver.RadeonSI, |
|
|
|
localStatisticsProvider, |
|
|
|
localStatisticsProvider, |
|
|
|
() => videoVersion); |
|
|
|
() => videoVersion); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -618,7 +618,7 @@ public class TranscodingTests |
|
|
|
now, |
|
|
|
now, |
|
|
|
Option<ChannelWatermark>.None, |
|
|
|
Option<ChannelWatermark>.None, |
|
|
|
channelWatermark, |
|
|
|
channelWatermark, |
|
|
|
VaapiDriver.Default, |
|
|
|
VaapiDriver.RadeonSI, |
|
|
|
"/dev/dri/renderD128", |
|
|
|
"/dev/dri/renderD128", |
|
|
|
Option<int>.None, |
|
|
|
Option<int>.None, |
|
|
|
false, |
|
|
|
false, |
|
|
|
@ -638,6 +638,7 @@ public class TranscodingTests |
|
|
|
profileBitDepth, |
|
|
|
profileBitDepth, |
|
|
|
profileVideoFormat, |
|
|
|
profileVideoFormat, |
|
|
|
profileAcceleration, |
|
|
|
profileAcceleration, |
|
|
|
|
|
|
|
VaapiDriver.RadeonSI, |
|
|
|
localStatisticsProvider, |
|
|
|
localStatisticsProvider, |
|
|
|
() => v); |
|
|
|
() => v); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -739,20 +740,16 @@ public class TranscodingTests |
|
|
|
|
|
|
|
|
|
|
|
var args = |
|
|
|
var args = |
|
|
|
$"-y -f lavfi -i anoisesrc=color=brown -f lavfi -i testsrc=duration=1:size={resolution}:rate=30 {videoFilter} -c:a aac -c:v {inputFormat.Encoder}{colorRange}{colorSpace}{colorTransfer}{colorPrimaries} -shortest -pix_fmt {inputFormat.PixelFormat} -strict -2 {flags} {file}"; |
|
|
|
$"-y -f lavfi -i anoisesrc=color=brown -f lavfi -i testsrc=duration=1:size={resolution}:rate=30 {videoFilter} -c:a aac -c:v {inputFormat.Encoder}{colorRange}{colorSpace}{colorTransfer}{colorPrimaries} -shortest -pix_fmt {inputFormat.PixelFormat} -strict -2 {flags} {file}"; |
|
|
|
var p1 = new Process |
|
|
|
BufferedCommandResult p1 = await Cli.Wrap(ExecutableName("ffmpeg")) |
|
|
|
{ |
|
|
|
.WithArguments(args) |
|
|
|
StartInfo = new ProcessStartInfo |
|
|
|
.WithValidation(CommandResultValidation.None) |
|
|
|
{ |
|
|
|
.ExecuteBufferedAsync(); |
|
|
|
FileName = ExecutableName("ffmpeg"), |
|
|
|
|
|
|
|
Arguments = args |
|
|
|
string output = string.IsNullOrWhiteSpace(p1.StandardOutput) |
|
|
|
} |
|
|
|
? p1.StandardError |
|
|
|
}; |
|
|
|
: p1.StandardOutput; |
|
|
|
|
|
|
|
|
|
|
|
p1.Start(); |
|
|
|
p1.ExitCode.Should().Be(0, output); |
|
|
|
await p1.WaitForExitAsync(); |
|
|
|
|
|
|
|
// ReSharper disable once MethodHasAsyncOverload
|
|
|
|
|
|
|
|
p1.WaitForExit(); |
|
|
|
|
|
|
|
p1.ExitCode.Should().Be(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (subtitle) |
|
|
|
switch (subtitle) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -871,7 +868,7 @@ public class TranscodingTests |
|
|
|
MemoryCache, |
|
|
|
MemoryCache, |
|
|
|
LoggerFactory.CreateLogger<HardwareCapabilitiesFactory>()), |
|
|
|
LoggerFactory.CreateLogger<HardwareCapabilitiesFactory>()), |
|
|
|
LoggerFactory.CreateLogger<PipelineBuilderFactory>()), |
|
|
|
LoggerFactory.CreateLogger<PipelineBuilderFactory>()), |
|
|
|
new Mock<ConfigElementRepository>().Object, |
|
|
|
new Mock<IConfigElementRepository>().Object, |
|
|
|
LoggerFactory.CreateLogger<FFmpegLibraryProcessService>()); |
|
|
|
LoggerFactory.CreateLogger<FFmpegLibraryProcessService>()); |
|
|
|
|
|
|
|
|
|
|
|
return service; |
|
|
|
return service; |
|
|
|
@ -883,6 +880,7 @@ public class TranscodingTests |
|
|
|
FFmpegProfileBitDepth profileBitDepth, |
|
|
|
FFmpegProfileBitDepth profileBitDepth, |
|
|
|
FFmpegProfileVideoFormat profileVideoFormat, |
|
|
|
FFmpegProfileVideoFormat profileVideoFormat, |
|
|
|
HardwareAccelerationKind profileAcceleration, |
|
|
|
HardwareAccelerationKind profileAcceleration, |
|
|
|
|
|
|
|
VaapiDriver vaapiDriver, |
|
|
|
ILocalStatisticsProvider localStatisticsProvider, |
|
|
|
ILocalStatisticsProvider localStatisticsProvider, |
|
|
|
Func<MediaVersion> getFinalMediaVersion) |
|
|
|
Func<MediaVersion> getFinalMediaVersion) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -995,8 +993,10 @@ public class TranscodingTests |
|
|
|
|
|
|
|
|
|
|
|
// AMF doesn't seem to set this metadata properly
|
|
|
|
// AMF doesn't seem to set this metadata properly
|
|
|
|
// MPEG2Video doesn't always seem to set this properly
|
|
|
|
// MPEG2Video doesn't always seem to set this properly
|
|
|
|
|
|
|
|
// RADEONSI driver doesn't set this properly
|
|
|
|
if (profileAcceleration != HardwareAccelerationKind.Amf && |
|
|
|
if (profileAcceleration != HardwareAccelerationKind.Amf && |
|
|
|
profileVideoFormat != FFmpegProfileVideoFormat.Mpeg2Video) |
|
|
|
profileVideoFormat != FFmpegProfileVideoFormat.Mpeg2Video && |
|
|
|
|
|
|
|
(profileAcceleration != HardwareAccelerationKind.Vaapi || vaapiDriver != VaapiDriver.RadeonSI)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
colorParams.IsBt709.Should().BeTrue($"{colorParams}"); |
|
|
|
colorParams.IsBt709.Should().BeTrue($"{colorParams}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|