Browse Source

remove legacy transcoder logic option (#717)

pull/719/head
Jason Dove 4 years ago committed by GitHub
parent
commit
e697fd36e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 6
      ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegSettingsHandler.cs
  3. 1
      ErsatzTV.Application/FFmpegProfiles/FFmpegSettingsViewModel.cs
  4. 3
      ErsatzTV.Application/FFmpegProfiles/Queries/GetFFmpegSettingsHandler.cs
  5. 10
      ErsatzTV.Application/Streaming/Queries/GetConcatProcessByChannelNumberHandler.cs
  6. 17
      ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs
  7. 10
      ErsatzTV.Application/Streaming/Queries/GetWrappedProcessByChannelNumberHandler.cs
  8. 1
      ErsatzTV.Core/Domain/ConfigElementKey.cs
  9. 28
      ErsatzTV.Core/FFmpeg/FFmpegProcessServiceFactory.cs
  10. 8
      ErsatzTV.Core/FFmpeg/IFFmpegProcessServiceFactory.cs
  11. 9
      ErsatzTV.Core/FFmpeg/SongVideoGenerator.cs
  12. 12
      ErsatzTV.Core/Metadata/LocalFolderScanner.cs
  13. 5
      ErsatzTV.Core/Metadata/MovieFolderScanner.cs
  14. 5
      ErsatzTV.Core/Metadata/MusicVideoFolderScanner.cs
  15. 5
      ErsatzTV.Core/Metadata/OtherVideoFolderScanner.cs
  16. 5
      ErsatzTV.Core/Metadata/SongFolderScanner.cs
  17. 5
      ErsatzTV.Core/Metadata/TelevisionFolderScanner.cs
  18. 6
      ErsatzTV/Pages/Settings.razor
  19. 4
      ErsatzTV/Startup.cs

2
CHANGELOG.md

@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased] ## [Unreleased]
### Changed
- Remove legacy transcoder logic option; all channels will use the new transcoder logic
## [0.4.5-alpha] - 2022-03-29 ## [0.4.5-alpha] - 2022-03-29
### Fixed ### Fixed

6
ErsatzTV.Application/FFmpegProfiles/Commands/UpdateFFmpegSettingsHandler.cs

@ -6,7 +6,7 @@ using ErsatzTV.Core.Interfaces.Repositories;
namespace ErsatzTV.Application.FFmpegProfiles; namespace ErsatzTV.Application.FFmpegProfiles;
public class UpdateFFmpegSettingsHandler : MediatR.IRequestHandler<UpdateFFmpegSettings, Either<BaseError, Unit>> public class UpdateFFmpegSettingsHandler : IRequestHandler<UpdateFFmpegSettings, Either<BaseError, Unit>>
{ {
private readonly IConfigElementRepository _configElementRepository; private readonly IConfigElementRepository _configElementRepository;
private readonly ILocalFileSystem _localFileSystem; private readonly ILocalFileSystem _localFileSystem;
@ -81,10 +81,6 @@ public class UpdateFFmpegSettingsHandler : MediatR.IRequestHandler<UpdateFFmpegS
Directory.CreateDirectory(FileSystemLayout.FFmpegReportsFolder); Directory.CreateDirectory(FileSystemLayout.FFmpegReportsFolder);
} }
await _configElementRepository.Upsert(
ConfigElementKey.FFmpegUseLegacyTranscoder,
request.Settings.UseLegacyTranscoder.ToString());
await _configElementRepository.Upsert( await _configElementRepository.Upsert(
ConfigElementKey.FFmpegPreferredLanguageCode, ConfigElementKey.FFmpegPreferredLanguageCode,
request.Settings.PreferredLanguageCode); request.Settings.PreferredLanguageCode);

1
ErsatzTV.Application/FFmpegProfiles/FFmpegSettingsViewModel.cs

@ -12,5 +12,4 @@ public class FFmpegSettingsViewModel
public int HlsSegmenterIdleTimeout { get; set; } public int HlsSegmenterIdleTimeout { get; set; }
public int WorkAheadSegmenterLimit { get; set; } public int WorkAheadSegmenterLimit { get; set; }
public int InitialSegmentCount { get; set; } public int InitialSegmentCount { get; set; }
public bool UseLegacyTranscoder { get; set; }
} }

3
ErsatzTV.Application/FFmpegProfiles/Queries/GetFFmpegSettingsHandler.cs

@ -32,8 +32,6 @@ public class GetFFmpegSettingsHandler : IRequestHandler<GetFFmpegSettings, FFmpe
await _configElementRepository.GetValue<int>(ConfigElementKey.FFmpegWorkAheadSegmenters); await _configElementRepository.GetValue<int>(ConfigElementKey.FFmpegWorkAheadSegmenters);
Option<int> initialSegmentCount = Option<int> initialSegmentCount =
await _configElementRepository.GetValue<int>(ConfigElementKey.FFmpegInitialSegmentCount); await _configElementRepository.GetValue<int>(ConfigElementKey.FFmpegInitialSegmentCount);
Option<bool> useLegacyTranscoder =
await _configElementRepository.GetValue<bool>(ConfigElementKey.FFmpegUseLegacyTranscoder);
var result = new FFmpegSettingsViewModel var result = new FFmpegSettingsViewModel
{ {
@ -45,7 +43,6 @@ public class GetFFmpegSettingsHandler : IRequestHandler<GetFFmpegSettings, FFmpe
HlsSegmenterIdleTimeout = await hlsSegmenterIdleTimeout.IfNoneAsync(60), HlsSegmenterIdleTimeout = await hlsSegmenterIdleTimeout.IfNoneAsync(60),
WorkAheadSegmenterLimit = await workAheadSegmenterLimit.IfNoneAsync(1), WorkAheadSegmenterLimit = await workAheadSegmenterLimit.IfNoneAsync(1),
InitialSegmentCount = await initialSegmentCount.IfNoneAsync(1), InitialSegmentCount = await initialSegmentCount.IfNoneAsync(1),
UseLegacyTranscoder = await useLegacyTranscoder.IfNoneAsync(false)
}; };
foreach (int watermarkId in watermark) foreach (int watermarkId in watermark)

10
ErsatzTV.Application/Streaming/Queries/GetConcatProcessByChannelNumberHandler.cs

@ -1,7 +1,6 @@
using System.Diagnostics; using System.Diagnostics;
using ErsatzTV.Core; using ErsatzTV.Core;
using ErsatzTV.Core.Domain; using ErsatzTV.Core.Domain;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Infrastructure.Data; using ErsatzTV.Infrastructure.Data;
using ErsatzTV.Infrastructure.Extensions; using ErsatzTV.Infrastructure.Extensions;
@ -11,14 +10,14 @@ namespace ErsatzTV.Application.Streaming;
public class GetConcatProcessByChannelNumberHandler : FFmpegProcessHandler<GetConcatProcessByChannelNumber> public class GetConcatProcessByChannelNumberHandler : FFmpegProcessHandler<GetConcatProcessByChannelNumber>
{ {
private readonly IFFmpegProcessServiceFactory _ffmpegProcessServiceFactory; private readonly IFFmpegProcessService _ffmpegProcessService;
public GetConcatProcessByChannelNumberHandler( public GetConcatProcessByChannelNumberHandler(
IDbContextFactory<TvContext> dbContextFactory, IDbContextFactory<TvContext> dbContextFactory,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory) IFFmpegProcessService ffmpegProcessService)
: base(dbContextFactory) : base(dbContextFactory)
{ {
_ffmpegProcessServiceFactory = ffmpegProcessServiceFactory; _ffmpegProcessService = ffmpegProcessService;
} }
protected override async Task<Either<BaseError, PlayoutItemProcessModel>> GetProcess( protected override async Task<Either<BaseError, PlayoutItemProcessModel>> GetProcess(
@ -32,8 +31,7 @@ public class GetConcatProcessByChannelNumberHandler : FFmpegProcessHandler<GetCo
.GetValue<bool>(ConfigElementKey.FFmpegSaveReports) .GetValue<bool>(ConfigElementKey.FFmpegSaveReports)
.Map(result => result.IfNone(false)); .Map(result => result.IfNone(false));
IFFmpegProcessService ffmpegProcessService = await _ffmpegProcessServiceFactory.GetService(); Process process = _ffmpegProcessService.ConcatChannel(
Process process = ffmpegProcessService.ConcatChannel(
ffmpegPath, ffmpegPath,
saveReports, saveReports,
channel, channel,

17
ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs

@ -4,7 +4,6 @@ using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Domain.Filler; using ErsatzTV.Core.Domain.Filler;
using ErsatzTV.Core.Errors; using ErsatzTV.Core.Errors;
using ErsatzTV.Core.Extensions; using ErsatzTV.Core.Extensions;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Interfaces.Emby; using ErsatzTV.Core.Interfaces.Emby;
using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Core.Interfaces.Jellyfin; using ErsatzTV.Core.Interfaces.Jellyfin;
@ -25,14 +24,14 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
private readonly ITelevisionRepository _televisionRepository; private readonly ITelevisionRepository _televisionRepository;
private readonly IArtistRepository _artistRepository; private readonly IArtistRepository _artistRepository;
private readonly IJellyfinPathReplacementService _jellyfinPathReplacementService; private readonly IJellyfinPathReplacementService _jellyfinPathReplacementService;
private readonly IFFmpegProcessServiceFactory _ffmpegProcessServiceFactory; private readonly IFFmpegProcessService _ffmpegProcessService;
private readonly ILocalFileSystem _localFileSystem; private readonly ILocalFileSystem _localFileSystem;
private readonly IPlexPathReplacementService _plexPathReplacementService; private readonly IPlexPathReplacementService _plexPathReplacementService;
private readonly ISongVideoGenerator _songVideoGenerator; private readonly ISongVideoGenerator _songVideoGenerator;
public GetPlayoutItemProcessByChannelNumberHandler( public GetPlayoutItemProcessByChannelNumberHandler(
IDbContextFactory<TvContext> dbContextFactory, IDbContextFactory<TvContext> dbContextFactory,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory, IFFmpegProcessService ffmpegProcessService,
ILocalFileSystem localFileSystem, ILocalFileSystem localFileSystem,
IPlexPathReplacementService plexPathReplacementService, IPlexPathReplacementService plexPathReplacementService,
IJellyfinPathReplacementService jellyfinPathReplacementService, IJellyfinPathReplacementService jellyfinPathReplacementService,
@ -43,7 +42,7 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
ISongVideoGenerator songVideoGenerator) ISongVideoGenerator songVideoGenerator)
: base(dbContextFactory) : base(dbContextFactory)
{ {
_ffmpegProcessServiceFactory = ffmpegProcessServiceFactory; _ffmpegProcessService = ffmpegProcessService;
_localFileSystem = localFileSystem; _localFileSystem = localFileSystem;
_plexPathReplacementService = plexPathReplacementService; _plexPathReplacementService = plexPathReplacementService;
_jellyfinPathReplacementService = jellyfinPathReplacementService; _jellyfinPathReplacementService = jellyfinPathReplacementService;
@ -106,8 +105,6 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
maybePlayoutItem = await CheckForFallbackFiller(dbContext, channel, now); maybePlayoutItem = await CheckForFallbackFiller(dbContext, channel, now);
} }
IFFmpegProcessService ffmpegProcessService = await _ffmpegProcessServiceFactory.GetService();
foreach (PlayoutItemWithPath playoutItemWithPath in maybePlayoutItem.RightToSeq()) foreach (PlayoutItemWithPath playoutItemWithPath in maybePlayoutItem.RightToSeq())
{ {
MediaVersion version = playoutItemWithPath.PlayoutItem.MediaItem.GetHeadVersion(); MediaVersion version = playoutItemWithPath.PlayoutItem.MediaItem.GetHeadVersion();
@ -138,7 +135,7 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
.GetValue<bool>(ConfigElementKey.FFmpegSaveReports) .GetValue<bool>(ConfigElementKey.FFmpegSaveReports)
.Map(result => result.IfNone(false)); .Map(result => result.IfNone(false));
Process process = await ffmpegProcessService.ForPlayoutItem( Process process = await _ffmpegProcessService.ForPlayoutItem(
ffmpegPath, ffmpegPath,
saveReports, saveReports,
channel, channel,
@ -179,7 +176,7 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
switch (error) switch (error)
{ {
case UnableToLocatePlayoutItem: case UnableToLocatePlayoutItem:
Process offlineProcess = await ffmpegProcessService.ForError( Process offlineProcess = await _ffmpegProcessService.ForError(
ffmpegPath, ffmpegPath,
channel, channel,
maybeDuration, maybeDuration,
@ -189,7 +186,7 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
return new PlayoutItemProcessModel(offlineProcess, finish); return new PlayoutItemProcessModel(offlineProcess, finish);
case PlayoutItemDoesNotExistOnDisk: case PlayoutItemDoesNotExistOnDisk:
Process doesNotExistProcess = await ffmpegProcessService.ForError( Process doesNotExistProcess = await _ffmpegProcessService.ForError(
ffmpegPath, ffmpegPath,
channel, channel,
maybeDuration, maybeDuration,
@ -199,7 +196,7 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler<
return new PlayoutItemProcessModel(doesNotExistProcess, finish); return new PlayoutItemProcessModel(doesNotExistProcess, finish);
default: default:
Process errorProcess = await ffmpegProcessService.ForError( Process errorProcess = await _ffmpegProcessService.ForError(
ffmpegPath, ffmpegPath,
channel, channel,
maybeDuration, maybeDuration,

10
ErsatzTV.Application/Streaming/Queries/GetWrappedProcessByChannelNumberHandler.cs

@ -1,7 +1,6 @@
using System.Diagnostics; using System.Diagnostics;
using ErsatzTV.Core; using ErsatzTV.Core;
using ErsatzTV.Core.Domain; using ErsatzTV.Core.Domain;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Infrastructure.Data; using ErsatzTV.Infrastructure.Data;
using ErsatzTV.Infrastructure.Extensions; using ErsatzTV.Infrastructure.Extensions;
@ -11,14 +10,14 @@ namespace ErsatzTV.Application.Streaming;
public class GetWrappedProcessByChannelNumberHandler : FFmpegProcessHandler<GetWrappedProcessByChannelNumber> public class GetWrappedProcessByChannelNumberHandler : FFmpegProcessHandler<GetWrappedProcessByChannelNumber>
{ {
private readonly IFFmpegProcessServiceFactory _ffmpegProcessServiceFactory; private readonly IFFmpegProcessService _ffmpegProcessService;
public GetWrappedProcessByChannelNumberHandler( public GetWrappedProcessByChannelNumberHandler(
IDbContextFactory<TvContext> dbContextFactory, IDbContextFactory<TvContext> dbContextFactory,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory) IFFmpegProcessService ffmpegProcessService)
: base(dbContextFactory) : base(dbContextFactory)
{ {
_ffmpegProcessServiceFactory = ffmpegProcessServiceFactory; _ffmpegProcessService = ffmpegProcessService;
} }
protected override async Task<Either<BaseError, PlayoutItemProcessModel>> GetProcess( protected override async Task<Either<BaseError, PlayoutItemProcessModel>> GetProcess(
@ -32,8 +31,7 @@ public class GetWrappedProcessByChannelNumberHandler : FFmpegProcessHandler<GetW
.GetValue<bool>(ConfigElementKey.FFmpegSaveReports) .GetValue<bool>(ConfigElementKey.FFmpegSaveReports)
.Map(result => result.IfNone(false)); .Map(result => result.IfNone(false));
IFFmpegProcessService ffmpegProcessService = await _ffmpegProcessServiceFactory.GetService(); Process process = _ffmpegProcessService.WrapSegmenter(
Process process = ffmpegProcessService.WrapSegmenter(
ffmpegPath, ffmpegPath,
saveReports, saveReports,
channel, channel,

1
ErsatzTV.Core/Domain/ConfigElementKey.cs

@ -17,7 +17,6 @@ public class ConfigElementKey
public static ConfigElementKey FFmpegSegmenterTimeout => new("ffmpeg.segmenter.timeout_seconds"); public static ConfigElementKey FFmpegSegmenterTimeout => new("ffmpeg.segmenter.timeout_seconds");
public static ConfigElementKey FFmpegWorkAheadSegmenters => new("ffmpeg.segmenter.work_ahead_limit"); public static ConfigElementKey FFmpegWorkAheadSegmenters => new("ffmpeg.segmenter.work_ahead_limit");
public static ConfigElementKey FFmpegInitialSegmentCount => new("ffmpeg.segmenter.initial_segment_count"); public static ConfigElementKey FFmpegInitialSegmentCount => new("ffmpeg.segmenter.initial_segment_count");
public static ConfigElementKey FFmpegUseLegacyTranscoder => new("ffmpeg.use_legacy_transcoder");
public static ConfigElementKey SearchIndexVersion => new("search_index.version"); public static ConfigElementKey SearchIndexVersion => new("search_index.version");
public static ConfigElementKey HDHRTunerCount => new("hdhr.tuner_count"); public static ConfigElementKey HDHRTunerCount => new("hdhr.tuner_count");
public static ConfigElementKey ChannelsPageSize => new("pages.channels.page_size"); public static ConfigElementKey ChannelsPageSize => new("pages.channels.page_size");

28
ErsatzTV.Core/FFmpeg/FFmpegProcessServiceFactory.cs

@ -1,28 +0,0 @@
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Core.Interfaces.Repositories;
using Microsoft.Extensions.DependencyInjection;
namespace ErsatzTV.Core.FFmpeg;
public class FFmpegProcessServiceFactory : IFFmpegProcessServiceFactory
{
private readonly IConfigElementRepository _configElementRepository;
private readonly IServiceProvider _serviceProvider;
public FFmpegProcessServiceFactory(IConfigElementRepository configElementRepository, IServiceProvider serviceProvider)
{
_configElementRepository = configElementRepository;
_serviceProvider = serviceProvider;
}
public async Task<IFFmpegProcessService> GetService()
{
Option<bool> useLegacyTranscoder =
await _configElementRepository.GetValue<bool>(ConfigElementKey.FFmpegUseLegacyTranscoder);
return await useLegacyTranscoder.IfNoneAsync(false)
? _serviceProvider.GetRequiredService<FFmpegProcessService>()
: _serviceProvider.GetRequiredService<FFmpegLibraryProcessService>();
}
}

8
ErsatzTV.Core/FFmpeg/IFFmpegProcessServiceFactory.cs

@ -1,8 +0,0 @@
using ErsatzTV.Core.Interfaces.FFmpeg;
namespace ErsatzTV.Core.FFmpeg;
public interface IFFmpegProcessServiceFactory
{
Task<IFFmpegProcessService> GetService();
}

9
ErsatzTV.Core/FFmpeg/SongVideoGenerator.cs

@ -14,16 +14,16 @@ public class SongVideoGenerator : ISongVideoGenerator
private readonly ITempFilePool _tempFilePool; private readonly ITempFilePool _tempFilePool;
private readonly IImageCache _imageCache; private readonly IImageCache _imageCache;
private readonly IFFmpegProcessServiceFactory _ffmpegProcessServiceFactory; private readonly IFFmpegProcessService _ffmpegProcessService;
public SongVideoGenerator( public SongVideoGenerator(
ITempFilePool tempFilePool, ITempFilePool tempFilePool,
IImageCache imageCache, IImageCache imageCache,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory) IFFmpegProcessService ffmpegProcessService)
{ {
_tempFilePool = tempFilePool; _tempFilePool = tempFilePool;
_imageCache = imageCache; _imageCache = imageCache;
_ffmpegProcessServiceFactory = ffmpegProcessServiceFactory; _ffmpegProcessService = ffmpegProcessService;
} }
public async Task<Tuple<string, MediaVersion>> GenerateSongVideo( public async Task<Tuple<string, MediaVersion>> GenerateSongVideo(
@ -212,8 +212,7 @@ public class SongVideoGenerator : ISongVideoGenerator
new() { Path = videoPath } new() { Path = videoPath }
}; };
IFFmpegProcessService ffmpegProcessService = await _ffmpegProcessServiceFactory.GetService(); Either<BaseError, string> maybeSongImage = await _ffmpegProcessService.GenerateSongImage(
Either<BaseError, string> maybeSongImage = await ffmpegProcessService.GenerateSongImage(
ffmpegPath, ffmpegPath,
subtitleFile, subtitleFile,
channel, channel,

12
ErsatzTV.Core/Metadata/LocalFolderScanner.cs

@ -46,7 +46,7 @@ public abstract class LocalFolderScanner
.ToList(); .ToList();
private readonly IImageCache _imageCache; private readonly IImageCache _imageCache;
private readonly IFFmpegProcessServiceFactory _ffmpegProcessServiceFactory; private readonly IFFmpegProcessService _ffmpegProcessService;
private readonly ITempFilePool _tempFilePool; private readonly ITempFilePool _tempFilePool;
private readonly IClient _client; private readonly IClient _client;
@ -62,7 +62,7 @@ public abstract class LocalFolderScanner
IMetadataRepository metadataRepository, IMetadataRepository metadataRepository,
IMediaItemRepository mediaItemRepository, IMediaItemRepository mediaItemRepository,
IImageCache imageCache, IImageCache imageCache,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory, IFFmpegProcessService ffmpegProcessService,
ITempFilePool tempFilePool, ITempFilePool tempFilePool,
IClient client, IClient client,
ILogger logger) ILogger logger)
@ -72,7 +72,7 @@ public abstract class LocalFolderScanner
_metadataRepository = metadataRepository; _metadataRepository = metadataRepository;
_mediaItemRepository = mediaItemRepository; _mediaItemRepository = mediaItemRepository;
_imageCache = imageCache; _imageCache = imageCache;
_ffmpegProcessServiceFactory = ffmpegProcessServiceFactory; _ffmpegProcessService = ffmpegProcessService;
_tempFilePool = tempFilePool; _tempFilePool = tempFilePool;
_client = client; _client = client;
_logger = logger; _logger = logger;
@ -158,14 +158,12 @@ public abstract class LocalFolderScanner
// if ffmpeg path is passed, we need pre-processing // if ffmpeg path is passed, we need pre-processing
foreach (string path in ffmpegPath) foreach (string path in ffmpegPath)
{ {
IFFmpegProcessService ffmpegProcessService = await _ffmpegProcessServiceFactory.GetService();
artworkFile = await attachedPicIndex.Match( artworkFile = await attachedPicIndex.Match(
async picIndex => async picIndex =>
{ {
// extract attached pic (and convert to png) // extract attached pic (and convert to png)
string tempName = _tempFilePool.GetNextTempFile(TempFileCategory.CoverArt); string tempName = _tempFilePool.GetNextTempFile(TempFileCategory.CoverArt);
using Process process = ffmpegProcessService.ExtractAttachedPicAsPng( using Process process = _ffmpegProcessService.ExtractAttachedPicAsPng(
path, path,
artworkFile, artworkFile,
picIndex, picIndex,
@ -182,7 +180,7 @@ public abstract class LocalFolderScanner
{ {
// no attached pic index means convert to png // no attached pic index means convert to png
string tempName = _tempFilePool.GetNextTempFile(TempFileCategory.CoverArt); string tempName = _tempFilePool.GetNextTempFile(TempFileCategory.CoverArt);
using Process process = ffmpegProcessService.ConvertToPng(path, artworkFile, tempName); using Process process = _ffmpegProcessService.ConvertToPng(path, artworkFile, tempName);
await Cli.Wrap(process.StartInfo.FileName) await Cli.Wrap(process.StartInfo.FileName)
.WithArguments(process.StartInfo.ArgumentList) .WithArguments(process.StartInfo.ArgumentList)

5
ErsatzTV.Core/Metadata/MovieFolderScanner.cs

@ -1,6 +1,5 @@
using Bugsnag; using Bugsnag;
using ErsatzTV.Core.Domain; using ErsatzTV.Core.Domain;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Core.Interfaces.Images; using ErsatzTV.Core.Interfaces.Images;
using ErsatzTV.Core.Interfaces.Metadata; using ErsatzTV.Core.Interfaces.Metadata;
@ -36,7 +35,7 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
ILibraryRepository libraryRepository, ILibraryRepository libraryRepository,
IMediaItemRepository mediaItemRepository, IMediaItemRepository mediaItemRepository,
IMediator mediator, IMediator mediator,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory, IFFmpegProcessService ffmpegProcessService,
ITempFilePool tempFilePool, ITempFilePool tempFilePool,
IClient client, IClient client,
ILogger<MovieFolderScanner> logger) ILogger<MovieFolderScanner> logger)
@ -46,7 +45,7 @@ public class MovieFolderScanner : LocalFolderScanner, IMovieFolderScanner
metadataRepository, metadataRepository,
mediaItemRepository, mediaItemRepository,
imageCache, imageCache,
ffmpegProcessServiceFactory, ffmpegProcessService,
tempFilePool, tempFilePool,
client, client,
logger) logger)

5
ErsatzTV.Core/Metadata/MusicVideoFolderScanner.cs

@ -1,6 +1,5 @@
using Bugsnag; using Bugsnag;
using ErsatzTV.Core.Domain; using ErsatzTV.Core.Domain;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Core.Interfaces.Images; using ErsatzTV.Core.Interfaces.Images;
using ErsatzTV.Core.Interfaces.Metadata; using ErsatzTV.Core.Interfaces.Metadata;
@ -37,7 +36,7 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
ILibraryRepository libraryRepository, ILibraryRepository libraryRepository,
IMediaItemRepository mediaItemRepository, IMediaItemRepository mediaItemRepository,
IMediator mediator, IMediator mediator,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory, IFFmpegProcessService ffmpegProcessService,
ITempFilePool tempFilePool, ITempFilePool tempFilePool,
IClient client, IClient client,
ILogger<MusicVideoFolderScanner> logger) : base( ILogger<MusicVideoFolderScanner> logger) : base(
@ -46,7 +45,7 @@ public class MusicVideoFolderScanner : LocalFolderScanner, IMusicVideoFolderScan
metadataRepository, metadataRepository,
mediaItemRepository, mediaItemRepository,
imageCache, imageCache,
ffmpegProcessServiceFactory, ffmpegProcessService,
tempFilePool, tempFilePool,
client, client,
logger) logger)

5
ErsatzTV.Core/Metadata/OtherVideoFolderScanner.cs

@ -1,6 +1,5 @@
using Bugsnag; using Bugsnag;
using ErsatzTV.Core.Domain; using ErsatzTV.Core.Domain;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Core.Interfaces.Images; using ErsatzTV.Core.Interfaces.Images;
using ErsatzTV.Core.Interfaces.Metadata; using ErsatzTV.Core.Interfaces.Metadata;
@ -35,7 +34,7 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
IOtherVideoRepository otherVideoRepository, IOtherVideoRepository otherVideoRepository,
ILibraryRepository libraryRepository, ILibraryRepository libraryRepository,
IMediaItemRepository mediaItemRepository, IMediaItemRepository mediaItemRepository,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory, IFFmpegProcessService ffmpegProcessService,
ITempFilePool tempFilePool, ITempFilePool tempFilePool,
IClient client, IClient client,
ILogger<OtherVideoFolderScanner> logger) : base( ILogger<OtherVideoFolderScanner> logger) : base(
@ -44,7 +43,7 @@ public class OtherVideoFolderScanner : LocalFolderScanner, IOtherVideoFolderScan
metadataRepository, metadataRepository,
mediaItemRepository, mediaItemRepository,
imageCache, imageCache,
ffmpegProcessServiceFactory, ffmpegProcessService,
tempFilePool, tempFilePool,
client, client,
logger) logger)

5
ErsatzTV.Core/Metadata/SongFolderScanner.cs

@ -1,7 +1,6 @@
using Bugsnag; using Bugsnag;
using ErsatzTV.Core.Domain; using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Extensions; using ErsatzTV.Core.Extensions;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Core.Interfaces.Images; using ErsatzTV.Core.Interfaces.Images;
using ErsatzTV.Core.Interfaces.Metadata; using ErsatzTV.Core.Interfaces.Metadata;
@ -36,7 +35,7 @@ public class SongFolderScanner : LocalFolderScanner, ISongFolderScanner
ISongRepository songRepository, ISongRepository songRepository,
ILibraryRepository libraryRepository, ILibraryRepository libraryRepository,
IMediaItemRepository mediaItemRepository, IMediaItemRepository mediaItemRepository,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory, IFFmpegProcessService ffmpegProcessService,
ITempFilePool tempFilePool, ITempFilePool tempFilePool,
IClient client, IClient client,
ILogger<SongFolderScanner> logger) : base( ILogger<SongFolderScanner> logger) : base(
@ -45,7 +44,7 @@ public class SongFolderScanner : LocalFolderScanner, ISongFolderScanner
metadataRepository, metadataRepository,
mediaItemRepository, mediaItemRepository,
imageCache, imageCache,
ffmpegProcessServiceFactory, ffmpegProcessService,
tempFilePool, tempFilePool,
client, client,
logger) logger)

5
ErsatzTV.Core/Metadata/TelevisionFolderScanner.cs

@ -1,6 +1,5 @@
using Bugsnag; using Bugsnag;
using ErsatzTV.Core.Domain; using ErsatzTV.Core.Domain;
using ErsatzTV.Core.FFmpeg;
using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Core.Interfaces.Images; using ErsatzTV.Core.Interfaces.Images;
using ErsatzTV.Core.Interfaces.Metadata; using ErsatzTV.Core.Interfaces.Metadata;
@ -36,7 +35,7 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
ILibraryRepository libraryRepository, ILibraryRepository libraryRepository,
IMediaItemRepository mediaItemRepository, IMediaItemRepository mediaItemRepository,
IMediator mediator, IMediator mediator,
IFFmpegProcessServiceFactory ffmpegProcessServiceFactory, IFFmpegProcessService ffmpegProcessService,
ITempFilePool tempFilePool, ITempFilePool tempFilePool,
IClient client, IClient client,
ILogger<TelevisionFolderScanner> logger) : base( ILogger<TelevisionFolderScanner> logger) : base(
@ -45,7 +44,7 @@ public class TelevisionFolderScanner : LocalFolderScanner, ITelevisionFolderScan
metadataRepository, metadataRepository,
mediaItemRepository, mediaItemRepository,
imageCache, imageCache,
ffmpegProcessServiceFactory, ffmpegProcessService,
tempFilePool, tempFilePool,
client, client,
logger) logger)

6
ErsatzTV/Pages/Settings.razor

@ -94,12 +94,6 @@
Required="true" Required="true"
RequiredError="HLS Segmenter initial segment count is required!"/> RequiredError="HLS Segmenter initial segment count is required!"/>
</MudElement> </MudElement>
<MudElement HtmlTag="div" Class="mt-3">
<MudSwitch T="bool"
Label="Use Legacy Transcoder Logic"
Color="Color.Primary"
@bind-Checked="@_ffmpegSettings.UseLegacyTranscoder"/>
</MudElement>
</MudForm> </MudForm>
</MudCardContent> </MudCardContent>
<MudCardActions> <MudCardActions>

4
ErsatzTV/Startup.cs

@ -381,9 +381,7 @@ public class Startup
services.AddScoped<IPlexPathReplacementService, PlexPathReplacementService>(); services.AddScoped<IPlexPathReplacementService, PlexPathReplacementService>();
services.AddScoped<IFFmpegStreamSelector, FFmpegStreamSelector>(); services.AddScoped<IFFmpegStreamSelector, FFmpegStreamSelector>();
// services.AddScoped<IFFmpegProcessService, FFmpegProcessService>(); services.AddScoped<IFFmpegProcessService, FFmpegLibraryProcessService>();
services.AddScoped<IFFmpegProcessServiceFactory, FFmpegProcessServiceFactory>();
services.AddScoped<FFmpegLibraryProcessService>();
services.AddScoped<FFmpegProcessService>(); services.AddScoped<FFmpegProcessService>();
services.AddScoped<ISongVideoGenerator, SongVideoGenerator>(); services.AddScoped<ISongVideoGenerator, SongVideoGenerator>();

Loading…
Cancel
Save