add vaapi display option to ffmpeg profile (#1948)

* add vaapi display option

* fix vaapi capabilities cache key

* update logging
This commit is contained in:
Jason Dove
2024-11-25 13:14:21 -06:00
committed by GitHub
parent dc112f0c7d
commit 759052c725
27 changed files with 11802 additions and 33 deletions
@@ -59,6 +59,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
DateTimeOffset now,
Option<ChannelWatermark> playoutItemWatermark,
Option<ChannelWatermark> globalWatermark,
string vaapiDisplay,
VaapiDriver vaapiDriver,
string vaapiDevice,
Option<int> qsvExtraHardwareFrames,
@@ -408,6 +409,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
watermarkInputFile,
subtitleInputFile,
Option<ConcatInputFile>.None,
VaapiDisplayName(hwAccel, vaapiDisplay),
VaapiDriverName(hwAccel, vaapiDriver),
VaapiDeviceName(hwAccel, vaapiDevice),
FileSystemLayout.FFmpegReportsFolder,
@@ -428,6 +430,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
string errorMessage,
bool hlsRealtime,
long ptsOffset,
string vaapiDisplay,
VaapiDriver vaapiDriver,
string vaapiDevice,
Option<int> qsvExtraHardwareFrames)
@@ -569,6 +572,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
None,
subtitleInputFile,
Option<ConcatInputFile>.None,
VaapiDisplayName(hwAccel, vaapiDisplay),
VaapiDriverName(hwAccel, vaapiDriver),
VaapiDeviceName(hwAccel, vaapiDevice),
FileSystemLayout.FFmpegReportsFolder,
@@ -600,6 +604,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
None,
None,
concatInputFile,
Option<string>.None,
None,
None,
FileSystemLayout.FFmpegReportsFolder,
@@ -717,6 +722,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
playbackSettings.VideoTrackTimeScale,
playbackSettings.Deinterlace);
Option<string> vaapiDisplay = VaapiDisplayName(hwAccel, channel.FFmpegProfile.VaapiDisplay);
Option<string> vaapiDriver = VaapiDriverName(hwAccel, channel.FFmpegProfile.VaapiDriver);
Option<string> vaapiDevice = VaapiDeviceName(hwAccel, channel.FFmpegProfile.VaapiDevice);
@@ -751,6 +757,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
watermarkInputFile,
subtitleInputFile,
concatInputFile,
vaapiDisplay,
vaapiDriver,
vaapiDevice,
FileSystemLayout.FFmpegReportsFolder,
@@ -790,6 +797,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
None,
None,
concatInputFile,
Option<string>.None,
None,
None,
FileSystemLayout.FFmpegReportsFolder,
@@ -830,6 +838,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
None,
None,
Option<ConcatInputFile>.None,
Option<string>.None,
None,
None,
FileSystemLayout.FFmpegReportsFolder,
@@ -988,6 +997,9 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
.WithEnvironmentVariables(environmentVariables.ToDictionary(e => e.Key, e => e.Value));
}
private static Option<string> VaapiDisplayName(HardwareAccelerationMode accelerationMode, string vaapiDisplay) =>
accelerationMode == HardwareAccelerationMode.Vaapi ? vaapiDisplay : Option<string>.None;
private static Option<string> VaapiDriverName(HardwareAccelerationMode accelerationMode, VaapiDriver driver)
{
if (accelerationMode == HardwareAccelerationMode.Vaapi)