diff --git a/CHANGELOG.md b/CHANGELOG.md index ffa21c23f..6f5f844fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Plex, Jellyfin and Emby libraries now direct stream content when files are not found on ErsatzTV's file system - Content will still be normalized according to the Channel and FFmpeg Profile settings - Streaming from disk is preferred, so every playback attempt will first check the local file system -- Update Intel Media Driver in vaapi docker image +- Use libvpl instead of libmfx to provide intel acceleration in vaapi docker images - Search queries no longer remove duplicate results as this was causing incorrect behavior ## [0.7.4-beta] - 2023-02-12 diff --git a/ErsatzTV.FFmpeg/Filter/HardwareDownloadFilter.cs b/ErsatzTV.FFmpeg/Filter/HardwareDownloadFilter.cs index c3df1d5b2..59091b58c 100644 --- a/ErsatzTV.FFmpeg/Filter/HardwareDownloadFilter.cs +++ b/ErsatzTV.FFmpeg/Filter/HardwareDownloadFilter.cs @@ -18,6 +18,14 @@ public class HardwareDownloadFilter : BaseFilter hwdownload = "hwdownload"; foreach (IPixelFormat pixelFormat in _currentState.PixelFormat) { + if (pixelFormat is PixelFormatVaapi) + { + foreach (IPixelFormat pf in AvailablePixelFormats.ForPixelFormat(pixelFormat.Name, null)) + { + return $"hwdownload,format=vaapi|{pf.FFmpegName}"; + } + } + if (!string.IsNullOrWhiteSpace(pixelFormat.FFmpegName)) { hwdownload = $"hwdownload,format={pixelFormat.FFmpegName}"; diff --git a/ErsatzTV.FFmpeg/Filter/PadFilter.cs b/ErsatzTV.FFmpeg/Filter/PadFilter.cs index 7da835fa1..372e7e4bf 100644 --- a/ErsatzTV.FFmpeg/Filter/PadFilter.cs +++ b/ErsatzTV.FFmpeg/Filter/PadFilter.cs @@ -1,4 +1,6 @@ -namespace ErsatzTV.FFmpeg.Filter; +using ErsatzTV.FFmpeg.Format; + +namespace ErsatzTV.FFmpeg.Filter; public class PadFilter : BaseFilter { @@ -16,13 +18,20 @@ public class PadFilter : BaseFilter get { string pad = $"pad={_paddedSize.Width}:{_paddedSize.Height}:-1:-1:color=black"; - string pixelFormat = _currentState.PixelFormat.Match(pf => pf.FFmpegName, () => string.Empty); if (_currentState.FrameDataLocation == FrameDataLocation.Hardware) { - if (!string.IsNullOrWhiteSpace(pixelFormat)) + foreach (IPixelFormat pixelFormat in _currentState.PixelFormat) { - return $"hwdownload,format={pixelFormat},{pad}"; + if (pixelFormat is PixelFormatVaapi) + { + foreach (IPixelFormat pf in AvailablePixelFormats.ForPixelFormat(pixelFormat.Name, null)) + { + return $"hwdownload,format=vaapi|{pf.FFmpegName},{pad}"; + } + } + + return $"hwdownload,format={pixelFormat.FFmpegName},{pad}"; } return $"hwdownload,{pad}"; diff --git a/ErsatzTV.FFmpeg/Format/FFmpegFormat.cs b/ErsatzTV.FFmpeg/Format/FFmpegFormat.cs index d627fe1a4..3458fda20 100644 --- a/ErsatzTV.FFmpeg/Format/FFmpegFormat.cs +++ b/ErsatzTV.FFmpeg/Format/FFmpegFormat.cs @@ -8,4 +8,5 @@ public class FFmpegFormat public const string YUVA420P = "yuva420p"; public const string P010LE = "p010le"; public const string NV12 = "nv12"; + public const string VAAPI = "vaapi"; } diff --git a/ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs b/ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs index ccb839e62..5508bbb54 100644 --- a/ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs +++ b/ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs @@ -183,9 +183,9 @@ public class TranscodingTests public static HardwareAccelerationKind[] TestAccelerations = { // HardwareAccelerationKind.None, - HardwareAccelerationKind.Nvenc, - // HardwareAccelerationKind.Vaapi, - // HardwareAccelerationKind.Qsv, + // HardwareAccelerationKind.Nvenc, + HardwareAccelerationKind.Vaapi, + HardwareAccelerationKind.Qsv, // HardwareAccelerationKind.VideoToolbox, // HardwareAccelerationKind.Amf };