|
|
@ -1,10 +1,13 @@ |
|
|
|
|
|
|
|
using System.Runtime.InteropServices; |
|
|
|
using System.Text.Json; |
|
|
|
using System.Text.Json; |
|
|
|
using System.Text.Json.Serialization; |
|
|
|
using System.Text.Json.Serialization; |
|
|
|
using CliWrap; |
|
|
|
using CliWrap; |
|
|
|
using CliWrap.Buffered; |
|
|
|
using CliWrap.Buffered; |
|
|
|
using ErsatzTV.Core; |
|
|
|
using ErsatzTV.Core; |
|
|
|
|
|
|
|
using ErsatzTV.Core.Domain; |
|
|
|
using ErsatzTV.Core.Interfaces.Locking; |
|
|
|
using ErsatzTV.Core.Interfaces.Locking; |
|
|
|
using ErsatzTV.Core.Notifications; |
|
|
|
using ErsatzTV.Core.Notifications; |
|
|
|
|
|
|
|
using ErsatzTV.FFmpeg.Runtime; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
|
|
|
|
|
|
|
|
namespace ErsatzTV.Application.Troubleshooting; |
|
|
|
namespace ErsatzTV.Application.Troubleshooting; |
|
|
@ -12,6 +15,7 @@ namespace ErsatzTV.Application.Troubleshooting; |
|
|
|
public class StartTroubleshootingPlaybackHandler( |
|
|
|
public class StartTroubleshootingPlaybackHandler( |
|
|
|
IMediator mediator, |
|
|
|
IMediator mediator, |
|
|
|
IEntityLocker entityLocker, |
|
|
|
IEntityLocker entityLocker, |
|
|
|
|
|
|
|
IRuntimeInfo runtimeInfo, |
|
|
|
ILogger<StartTroubleshootingPlaybackHandler> logger) |
|
|
|
ILogger<StartTroubleshootingPlaybackHandler> logger) |
|
|
|
: IRequestHandler<StartTroubleshootingPlayback> |
|
|
|
: IRequestHandler<StartTroubleshootingPlayback> |
|
|
|
{ |
|
|
|
{ |
|
|
@ -41,6 +45,8 @@ public class StartTroubleshootingPlaybackHandler( |
|
|
|
Environment = request.TroubleshootingInfo.Environment.OrderBy(x => x.Key) |
|
|
|
Environment = request.TroubleshootingInfo.Environment.OrderBy(x => x.Key) |
|
|
|
.ToDictionary(x => x.Key, x => x.Value), |
|
|
|
.ToDictionary(x => x.Key, x => x.Value), |
|
|
|
request.TroubleshootingInfo.Health, |
|
|
|
request.TroubleshootingInfo.Health, |
|
|
|
|
|
|
|
request.TroubleshootingInfo.Cpus, |
|
|
|
|
|
|
|
request.TroubleshootingInfo.VideoControllers, |
|
|
|
request.TroubleshootingInfo.FFmpegSettings, |
|
|
|
request.TroubleshootingInfo.FFmpegSettings, |
|
|
|
request.TroubleshootingInfo.FFmpegProfiles, |
|
|
|
request.TroubleshootingInfo.FFmpegProfiles, |
|
|
|
request.TroubleshootingInfo.Watermarks |
|
|
|
request.TroubleshootingInfo.Watermarks |
|
|
@ -51,6 +57,32 @@ public class StartTroubleshootingPlaybackHandler( |
|
|
|
troubleshootingInfoJson, |
|
|
|
troubleshootingInfoJson, |
|
|
|
cancellationToken); |
|
|
|
cancellationToken); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HardwareAccelerationKind hwAccel = request.TroubleshootingInfo.FFmpegProfiles.Head().HardwareAcceleration; |
|
|
|
|
|
|
|
if (hwAccel is HardwareAccelerationKind.Qsv) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
await File.WriteAllTextAsync( |
|
|
|
|
|
|
|
Path.Combine(FileSystemLayout.TranscodeTroubleshootingFolder, "capabilities_qsv.txt"), |
|
|
|
|
|
|
|
request.TroubleshootingInfo.QsvCapabilities, |
|
|
|
|
|
|
|
cancellationToken); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hwAccel is HardwareAccelerationKind.Vaapi || (hwAccel is HardwareAccelerationKind.Qsv && |
|
|
|
|
|
|
|
runtimeInfo.IsOSPlatform(OSPlatform.Linux))) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
await File.WriteAllTextAsync( |
|
|
|
|
|
|
|
Path.Combine(FileSystemLayout.TranscodeTroubleshootingFolder, "capabilities_vaapi.txt"), |
|
|
|
|
|
|
|
request.TroubleshootingInfo.VaapiCapabilities, |
|
|
|
|
|
|
|
cancellationToken); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hwAccel is HardwareAccelerationKind.Nvenc) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
await File.WriteAllTextAsync( |
|
|
|
|
|
|
|
Path.Combine(FileSystemLayout.TranscodeTroubleshootingFolder, "capabilities_nvidia.txt"), |
|
|
|
|
|
|
|
request.TroubleshootingInfo.NvidiaCapabilities, |
|
|
|
|
|
|
|
cancellationToken); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
logger.LogDebug("ffmpeg troubleshooting arguments {FFmpegArguments}", request.Command.Arguments); |
|
|
|
logger.LogDebug("ffmpeg troubleshooting arguments {FFmpegArguments}", request.Command.Arguments); |
|
|
|
|
|
|
|
|
|
|
|
BufferedCommandResult result = await request.Command |
|
|
|
BufferedCommandResult result = await request.Command |
|
|
|