add videotoolbox capabilities (#2239)
* implement videotoolbox hardware capabilities * add videotoolbox troubleshooting info * update changelog
This commit is contained in:
@@ -77,10 +77,11 @@
|
||||
</div>
|
||||
<MudSelect @bind-Value="_model.VideoProfile"
|
||||
For="@(() => _model.VideoProfile)"
|
||||
Disabled="@(_model.VideoFormat != FFmpegProfileVideoFormat.H264 || _model.HardwareAcceleration != HardwareAccelerationKind.Nvenc && _model.HardwareAcceleration != HardwareAccelerationKind.Qsv && _model.HardwareAcceleration != HardwareAccelerationKind.None)"
|
||||
Disabled="@(_model.VideoFormat != FFmpegProfileVideoFormat.H264 || _model.HardwareAcceleration != HardwareAccelerationKind.Nvenc && _model.HardwareAcceleration != HardwareAccelerationKind.Qsv && _model.HardwareAcceleration != HardwareAccelerationKind.VideoToolbox && _model.HardwareAcceleration != HardwareAccelerationKind.None)"
|
||||
Clearable="true">
|
||||
<MudSelectItem Value="@VideoProfile.Main">main</MudSelectItem>
|
||||
<MudSelectItem Value="@VideoProfile.High">high</MudSelectItem>
|
||||
<MudSelectItem Value="@VideoProfile.High10">high10</MudSelectItem>
|
||||
</MudSelect>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Breakpoint="Breakpoint.SmAndDown" Class="form-field-stack gap-md-8 mb-5">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@page "/system/troubleshooting"
|
||||
@using System.Runtime.InteropServices
|
||||
@using System.Text.Json
|
||||
@using System.Text.Json.Serialization
|
||||
@using ErsatzTV.Application.Troubleshooting
|
||||
@@ -27,42 +28,63 @@
|
||||
Copy
|
||||
</MudButton>
|
||||
</MudExpansionPanel>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">NVIDIA Capabilities</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudExpansionPanel Class="mb-6">
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
<code @ref="_nvidiaView">@_nvidiaCapabilities</code>
|
||||
</pre>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="() => CopyToClipboard(_nvidiaView)">
|
||||
Copy
|
||||
</MudButton>
|
||||
</MudExpansionPanel>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">QSV Capabilities</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudExpansionPanel Class="mb-6">
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
@if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">VideoToolbox Capabilities</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudExpansionPanel Class="mb-6">
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
<code @ref="_videoToolboxView">@_videoToolboxCapabilities</code>
|
||||
</pre>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="() => CopyToClipboard(_videoToolboxView)">
|
||||
Copy
|
||||
</MudButton>
|
||||
</MudExpansionPanel>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">NVIDIA Capabilities</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudExpansionPanel Class="mb-6">
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
<code @ref="_nvidiaView">@_nvidiaCapabilities</code>
|
||||
</pre>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="() => CopyToClipboard(_nvidiaView)">
|
||||
Copy
|
||||
</MudButton>
|
||||
</MudExpansionPanel>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">QSV Capabilities</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudExpansionPanel Class="mb-6">
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
<code @ref="_qsvView">@_qsvCapabilities</code>
|
||||
</pre>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="() => CopyToClipboard(_qsvView)">
|
||||
Copy
|
||||
</MudButton>
|
||||
</MudExpansionPanel>
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">VAAPI Capabilities</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudExpansionPanel Class="mb-6">
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="() => CopyToClipboard(_qsvView)">
|
||||
Copy
|
||||
</MudButton>
|
||||
</MudExpansionPanel>
|
||||
}
|
||||
@if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
<MudText Typo="Typo.h5" Class="mt-10 mb-2">VAAPI Capabilities</MudText>
|
||||
<MudDivider Class="mb-6"/>
|
||||
<MudExpansionPanel Class="mb-6">
|
||||
<div class="overflow-y-scroll" style="max-height: 500px">
|
||||
<pre>
|
||||
<code @ref="_vaapiView">@_vaapiCapabilities</code>
|
||||
</pre>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="() => CopyToClipboard(_vaapiView)">
|
||||
Copy
|
||||
</MudButton>
|
||||
</MudExpansionPanel>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" Class="mt-4" OnClick="() => CopyToClipboard(_vaapiView)">
|
||||
Copy
|
||||
</MudButton>
|
||||
</MudExpansionPanel>
|
||||
}
|
||||
</MudContainer>
|
||||
</div>
|
||||
</MudForm>
|
||||
@@ -73,10 +95,12 @@
|
||||
private string _nvidiaCapabilities;
|
||||
private string _qsvCapabilities;
|
||||
private string _vaapiCapabilities;
|
||||
private string _videoToolboxCapabilities;
|
||||
private ElementReference _troubleshootingView;
|
||||
private ElementReference _nvidiaView;
|
||||
private ElementReference _qsvView;
|
||||
private ElementReference _vaapiView;
|
||||
private ElementReference _videoToolboxView;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
@@ -112,6 +136,7 @@
|
||||
_nvidiaCapabilities = info.NvidiaCapabilities;
|
||||
_qsvCapabilities = info.QsvCapabilities;
|
||||
_vaapiCapabilities = info.VaapiCapabilities;
|
||||
_videoToolboxCapabilities = info.VideoToolboxCapabilities;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.FFmpeg.Format;
|
||||
using ErsatzTV.ViewModels;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
@@ -7,37 +8,37 @@ namespace ErsatzTV.Validators;
|
||||
|
||||
public class FFmpegProfileEditViewModelValidator : AbstractValidator<FFmpegProfileEditViewModel>
|
||||
{
|
||||
private static readonly List<FFmpegProfileVideoFormat> QsvFormats = new()
|
||||
{
|
||||
private static readonly List<FFmpegProfileVideoFormat> QsvFormats =
|
||||
[
|
||||
FFmpegProfileVideoFormat.H264,
|
||||
FFmpegProfileVideoFormat.Hevc,
|
||||
FFmpegProfileVideoFormat.Mpeg2Video
|
||||
};
|
||||
];
|
||||
|
||||
private static readonly List<FFmpegProfileVideoFormat> NvencFormats = new()
|
||||
{
|
||||
private static readonly List<FFmpegProfileVideoFormat> NvencFormats =
|
||||
[
|
||||
FFmpegProfileVideoFormat.H264,
|
||||
FFmpegProfileVideoFormat.Hevc
|
||||
};
|
||||
];
|
||||
|
||||
private static readonly List<FFmpegProfileVideoFormat> VaapiFormats = new()
|
||||
{
|
||||
private static readonly List<FFmpegProfileVideoFormat> VaapiFormats =
|
||||
[
|
||||
FFmpegProfileVideoFormat.H264,
|
||||
FFmpegProfileVideoFormat.Hevc,
|
||||
FFmpegProfileVideoFormat.Mpeg2Video
|
||||
};
|
||||
];
|
||||
|
||||
private static readonly List<FFmpegProfileVideoFormat> VideoToolboxFormats = new()
|
||||
{
|
||||
private static readonly List<FFmpegProfileVideoFormat> VideoToolboxFormats =
|
||||
[
|
||||
FFmpegProfileVideoFormat.H264,
|
||||
FFmpegProfileVideoFormat.Hevc
|
||||
};
|
||||
];
|
||||
|
||||
private static readonly List<FFmpegProfileVideoFormat> AmfFormats = new()
|
||||
{
|
||||
private static readonly List<FFmpegProfileVideoFormat> AmfFormats =
|
||||
[
|
||||
FFmpegProfileVideoFormat.H264,
|
||||
FFmpegProfileVideoFormat.Hevc
|
||||
};
|
||||
];
|
||||
|
||||
public FFmpegProfileEditViewModelValidator()
|
||||
{
|
||||
@@ -97,6 +98,18 @@ public class FFmpegProfileEditViewModelValidator : AbstractValidator<FFmpegProfi
|
||||
() => RuleFor(x => x.BitDepth)
|
||||
.Must(bd => bd is FFmpegProfileBitDepth.EightBit)
|
||||
.WithMessage("Mpeg2Video does not support 10-bit content"));
|
||||
|
||||
When(
|
||||
x => x.VideoFormat == FFmpegProfileVideoFormat.H264 && x.BitDepth == FFmpegProfileBitDepth.TenBit,
|
||||
() => RuleFor(x => x.VideoProfile)
|
||||
.Must(vp => vp == VideoProfile.High10)
|
||||
.WithMessage("VideoProfile must be high10 with 10-bit h264"));
|
||||
|
||||
When(
|
||||
x => x.VideoFormat == FFmpegProfileVideoFormat.H264 && x.BitDepth == FFmpegProfileBitDepth.EightBit,
|
||||
() => RuleFor(x => x.VideoProfile)
|
||||
.Must(vp => vp != VideoProfile.High10)
|
||||
.WithMessage("VideoProfile cannot be high10 with 8-bit h264"));
|
||||
}
|
||||
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
|
||||
Reference in New Issue
Block a user