Browse Source

fix some cases where vaapi hwdownload would fail; use libvpl in docker (#1177)

* fix some cases where vaapi hwdownload would fail

* update changelog
pull/1178/head
Jason Dove 3 years ago committed by GitHub
parent
commit
e5ef8eaf72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 8
      ErsatzTV.FFmpeg/Filter/HardwareDownloadFilter.cs
  3. 17
      ErsatzTV.FFmpeg/Filter/PadFilter.cs
  4. 1
      ErsatzTV.FFmpeg/Format/FFmpegFormat.cs
  5. 6
      ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs

2
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 - 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 - 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 - 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 - Search queries no longer remove duplicate results as this was causing incorrect behavior
## [0.7.4-beta] - 2023-02-12 ## [0.7.4-beta] - 2023-02-12

8
ErsatzTV.FFmpeg/Filter/HardwareDownloadFilter.cs

@ -18,6 +18,14 @@ public class HardwareDownloadFilter : BaseFilter
hwdownload = "hwdownload"; hwdownload = "hwdownload";
foreach (IPixelFormat pixelFormat in _currentState.PixelFormat) 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)) if (!string.IsNullOrWhiteSpace(pixelFormat.FFmpegName))
{ {
hwdownload = $"hwdownload,format={pixelFormat.FFmpegName}"; hwdownload = $"hwdownload,format={pixelFormat.FFmpegName}";

17
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 public class PadFilter : BaseFilter
{ {
@ -16,13 +18,20 @@ public class PadFilter : BaseFilter
get get
{ {
string pad = $"pad={_paddedSize.Width}:{_paddedSize.Height}:-1:-1:color=black"; 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 (_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}"; return $"hwdownload,{pad}";

1
ErsatzTV.FFmpeg/Format/FFmpegFormat.cs

@ -8,4 +8,5 @@ public class FFmpegFormat
public const string YUVA420P = "yuva420p"; public const string YUVA420P = "yuva420p";
public const string P010LE = "p010le"; public const string P010LE = "p010le";
public const string NV12 = "nv12"; public const string NV12 = "nv12";
public const string VAAPI = "vaapi";
} }

6
ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs

@ -183,9 +183,9 @@ 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
}; };

Loading…
Cancel
Save