diff --git a/Jellyfin.Plugin.SRFPlay/ScheduledTasks/RecordingSchedulerTask.cs b/Jellyfin.Plugin.SRFPlay/ScheduledTasks/RecordingSchedulerTask.cs index 0a92500..c5089ce 100644 --- a/Jellyfin.Plugin.SRFPlay/ScheduledTasks/RecordingSchedulerTask.cs +++ b/Jellyfin.Plugin.SRFPlay/ScheduledTasks/RecordingSchedulerTask.cs @@ -69,7 +69,7 @@ public class RecordingSchedulerTask : IScheduledTask new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, - IntervalTicks = TimeSpan.FromMinutes(2).Ticks + IntervalTicks = TimeSpan.FromSeconds(30).Ticks } }; } diff --git a/Jellyfin.Plugin.SRFPlay/Services/RecordingService.cs b/Jellyfin.Plugin.SRFPlay/Services/RecordingService.cs index acfb4f1..66946ce 100644 --- a/Jellyfin.Plugin.SRFPlay/Services/RecordingService.cs +++ b/Jellyfin.Plugin.SRFPlay/Services/RecordingService.cs @@ -14,6 +14,7 @@ using Jellyfin.Plugin.SRFPlay.Api.Models; using Jellyfin.Plugin.SRFPlay.Api.Models.PlayV3; using Jellyfin.Plugin.SRFPlay.Services.Interfaces; using MediaBrowser.Controller; +using MediaBrowser.Controller.MediaEncoding; using Microsoft.Extensions.Logging; namespace Jellyfin.Plugin.SRFPlay.Services; @@ -29,6 +30,7 @@ public class RecordingService : IRecordingService, IDisposable private readonly IStreamUrlResolver _streamUrlResolver; private readonly IMediaCompositionFetcher _mediaCompositionFetcher; private readonly IServerApplicationHost _appHost; + private readonly IMediaEncoder _mediaEncoder; private readonly ConcurrentDictionary _activeProcesses = new(); private static readonly JsonSerializerOptions _jsonOptions = new() { WriteIndented = true }; private readonly SemaphoreSlim _persistLock = new(1, 1); @@ -45,13 +47,15 @@ public class RecordingService : IRecordingService, IDisposable /// The stream URL resolver. /// The media composition fetcher. /// The application host. + /// The media encoder for ffmpeg path. public RecordingService( ILogger logger, ISRFApiClientFactory apiClientFactory, IStreamProxyService proxyService, IStreamUrlResolver streamUrlResolver, IMediaCompositionFetcher mediaCompositionFetcher, - IServerApplicationHost appHost) + IServerApplicationHost appHost, + IMediaEncoder mediaEncoder) { _logger = logger; _apiClientFactory = apiClientFactory; @@ -59,6 +63,7 @@ public class RecordingService : IRecordingService, IDisposable _streamUrlResolver = streamUrlResolver; _mediaCompositionFetcher = mediaCompositionFetcher; _appHost = appHost; + _mediaEncoder = mediaEncoder; } private string GetDataFilePath() @@ -416,7 +421,7 @@ public class RecordingService : IRecordingService, IDisposable { StartInfo = new ProcessStartInfo { - FileName = "ffmpeg", + FileName = _mediaEncoder.EncoderPath, Arguments = $"-y -i \"{inputUrl}\" -c copy -movflags +faststart \"{outputPath}\"", UseShellExecute = false, RedirectStandardInput = true,