Browse Source

vaapi improvements (#629)

* fix interlaced video with vaapi

* downgrade imagesharp to fix blurhash generation

* fix ui crash loading collection editor
pull/630/head
Jason Dove 5 years ago committed by GitHub
parent
commit
ea08453913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      CHANGELOG.md
  2. 15
      ErsatzTV.Application/MediaCards/Queries/GetCollectionCardsHandler.cs
  3. 2
      ErsatzTV.Application/MediaCollections/Queries/GetCollectionByIdHandler.cs
  4. 9
      ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs
  5. 2
      ErsatzTV.Infrastructure/Data/Repositories/MusicVideoRepository.cs
  6. 2
      ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj

3
CHANGELOG.md

@ -8,9 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -8,9 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Normalize smart quotes in search queries as they are unsupported by the search library
- Fix incorrect watermark time calculations caused by working ahead in `HLS Segmenter`
- Fix ui crash adding empty path to local library
- Fix ui crash loading collection editor
- Properly flag items as `File Not Found` when local library path (folder) is missing from disk
- Fix playback bug with unknown pixel format
- Fix playback of interlaced mpeg2video on NVIDIA
- Fix playback of interlaced mpeg2video on NVIDIA, VAAPI
### Added
- Include `Series` category tag for all episodes in XMLTV

15
ErsatzTV.Application/MediaCards/Queries/GetCollectionCardsHandler.cs

@ -47,6 +47,9 @@ namespace ErsatzTV.Application.MediaCards.Queries @@ -47,6 +47,9 @@ namespace ErsatzTV.Application.MediaCards.Queries
.ThenInclude(i => (i as Movie).MovieMetadata)
.ThenInclude(mm => mm.Artwork)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as Movie).MediaVersions)
.ThenInclude(mv => mv.MediaFiles)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as Artist).ArtistMetadata)
.ThenInclude(mvm => mvm.Artwork)
.Include(c => c.MediaItems)
@ -56,6 +59,9 @@ namespace ErsatzTV.Application.MediaCards.Queries @@ -56,6 +59,9 @@ namespace ErsatzTV.Application.MediaCards.Queries
.ThenInclude(i => (i as MusicVideo).Artist)
.ThenInclude(a => a.ArtistMetadata)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as MusicVideo).MediaVersions)
.ThenInclude(mv => mv.MediaFiles)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as Show).ShowMetadata)
.ThenInclude(sm => sm.Artwork)
.Include(c => c.MediaItems)
@ -81,11 +87,20 @@ namespace ErsatzTV.Application.MediaCards.Queries @@ -81,11 +87,20 @@ namespace ErsatzTV.Application.MediaCards.Queries
.ThenInclude(i => (i as Episode).Season)
.ThenInclude(s => s.SeasonMetadata)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as Episode).MediaVersions)
.ThenInclude(mv => mv.MediaFiles)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as OtherVideo).OtherVideoMetadata)
.ThenInclude(ovm => ovm.Artwork)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as OtherVideo).MediaVersions)
.ThenInclude(mv => mv.MediaFiles)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as Song).SongMetadata)
.ThenInclude(ovm => ovm.Artwork)
.Include(c => c.MediaItems)
.ThenInclude(i => (i as Song).MediaVersions)
.ThenInclude(mv => mv.MediaFiles)
.SelectOneAsync(c => c.Id, c => c.Id == request.Id)
.Map(c => c.ToEither(BaseError.New("Unable to load collection")))
.MapT(c => ProjectToViewModel(c, maybeJellyfin, maybeEmby));

2
ErsatzTV.Application/MediaCollections/Queries/GetCollectionByIdHandler.cs

@ -21,7 +21,7 @@ namespace ErsatzTV.Application.MediaCollections.Queries @@ -21,7 +21,7 @@ namespace ErsatzTV.Application.MediaCollections.Queries
GetCollectionById request,
CancellationToken cancellationToken)
{
await using TvContext dbContext = _dbContextFactory.CreateDbContext();
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync(cancellationToken);
return await dbContext.Collections
.SelectOneAsync(c => c.Id, c => c.Id == request.Id)
.MapT(ProjectToViewModel);

9
ErsatzTV.Core/FFmpeg/FFmpegComplexFilterBuilder.cs

@ -155,7 +155,8 @@ namespace ErsatzTV.Core.FFmpeg @@ -155,7 +155,8 @@ namespace ErsatzTV.Core.FFmpeg
bool isHardwareDecode = acceleration switch
{
HardwareAccelerationKind.Vaapi => !isSong && _inputCodec != "mpeg4",
HardwareAccelerationKind.Vaapi => !isSong && _inputCodec != "mpeg4" &&
(_deinterlace == false || !_pixelFormat.Contains("p10le")),
// we need an initial hwupload_cuda when only padding with these pixel formats
HardwareAccelerationKind.Nvenc when _scaleToSize.IsNone && _padToSize.IsSome =>
@ -252,9 +253,9 @@ namespace ErsatzTV.Core.FFmpeg @@ -252,9 +253,9 @@ namespace ErsatzTV.Core.FFmpeg
string[] h264hevc = { "h264", "hevc" };
if (acceleration == HardwareAccelerationKind.Vaapi && (_pixelFormat ?? string.Empty).EndsWith("p10le") &&
h264hevc.Contains(_inputCodec)
&& (_pixelFormat != "yuv420p10le" || _inputCodec != "hevc"))
if (_deinterlace == false && acceleration == HardwareAccelerationKind.Vaapi &&
(_pixelFormat ?? string.Empty).EndsWith("p10le") &&
h264hevc.Contains(_inputCodec) && (_pixelFormat != "yuv420p10le" || _inputCodec != "hevc"))
{
videoFilterQueue.Add("format=p010le,format=nv12|vaapi,hwupload");
}

2
ErsatzTV.Infrastructure/Data/Repositories/MusicVideoRepository.cs

@ -159,7 +159,7 @@ namespace ErsatzTV.Infrastructure.Data.Repositories @@ -159,7 +159,7 @@ namespace ErsatzTV.Infrastructure.Data.Repositories
public async Task<List<MusicVideoMetadata>> GetPagedMusicVideos(int artistId, int pageNumber, int pageSize)
{
await using TvContext dbContext = _dbContextFactory.CreateDbContext();
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync();
return await dbContext.MusicVideoMetadata
.AsNoTracking()
.Include(m => m.Artwork)

2
ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj

@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
<PackageReference Include="Refit" Version="6.3.2" />
<PackageReference Include="Refit.Newtonsoft.Json" Version="6.3.2" />
<PackageReference Include="Refit.Xml" Version="6.3.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.0.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
</ItemGroup>
<ItemGroup>

Loading…
Cancel
Save