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/). @@ -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

8
ErsatzTV.FFmpeg/Filter/HardwareDownloadFilter.cs

@ -18,6 +18,14 @@ public class HardwareDownloadFilter : BaseFilter @@ -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}";

17
ErsatzTV.FFmpeg/Filter/PadFilter.cs

@ -1,4 +1,6 @@ @@ -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 @@ -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}";

1
ErsatzTV.FFmpeg/Format/FFmpegFormat.cs

@ -8,4 +8,5 @@ public class FFmpegFormat @@ -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";
}

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

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

Loading…
Cancel
Save