Files
ersatztv/ErsatzTV.Application/Streaming/Queries/GetConcatSegmenterProcessByChannelNumberHandler.cs
T
Jason DoveandGitHub 35817f09ac add hls segmenter v2 streaming mode (#1620)
* concat segmenter process kind of works

* segmenter v2 improvements

* rework to allow hw accel in concat segmenter

* remove shortest; use different audio alignment filter

* hls v2 improvements

* fix tests

* update changelog
2024-02-19 13:59:33 -06:00

38 lines
1.3 KiB
C#

using CliWrap;
using ErsatzTV.Core;
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Interfaces.FFmpeg;
using ErsatzTV.Infrastructure.Data;
using ErsatzTV.Infrastructure.Extensions;
using Microsoft.EntityFrameworkCore;
namespace ErsatzTV.Application.Streaming;
public class GetConcatSegmenterProcessByChannelNumberHandler(
IDbContextFactory<TvContext> dbContextFactory,
IFFmpegProcessService ffmpegProcessService)
: FFmpegProcessHandler<GetConcatSegmenterProcessByChannelNumber>(dbContextFactory)
{
protected override async Task<Either<BaseError, PlayoutItemProcessModel>> GetProcess(
TvContext dbContext,
GetConcatSegmenterProcessByChannelNumber request,
Channel channel,
string ffmpegPath,
string ffprobePath,
CancellationToken cancellationToken)
{
bool saveReports = await dbContext.ConfigElements
.GetValue<bool>(ConfigElementKey.FFmpegSaveReports)
.Map(result => result.IfNone(false));
Command process = await ffmpegProcessService.ConcatSegmenterChannel(
ffmpegPath,
saveReports,
channel,
request.Scheme,
request.Host);
return new PlayoutItemProcessModel(process, Option<TimeSpan>.None, DateTimeOffset.MaxValue, true);
}
}