From ef6c8b08169df393984bdee8ba05d6d00fd9e34b Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Sun, 5 May 2024 19:23:26 -0500 Subject: [PATCH] allow clearing (omitting) video profile setting (#1706) --- ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs | 4 ++-- ErsatzTV/Pages/FFmpegEditor.razor | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs b/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs index 12c8f92b0..5a5f03cb3 100644 --- a/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs +++ b/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs @@ -449,7 +449,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService AudioFilter.None); var videoFormat = GetVideoFormat(playbackSettings); - + var desiredState = new FrameState( playbackSettings.RealtimeOutput, false, @@ -998,7 +998,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService }; private static Option GetVideoProfile(string videoFormat, string videoProfile) => - (videoFormat, videoProfile.ToLowerInvariant()) switch + (videoFormat, (videoProfile ?? string.Empty).ToLowerInvariant()) switch { (VideoFormat.H264, VideoProfile.Main) => VideoProfile.Main, (VideoFormat.H264, VideoProfile.High) => VideoProfile.High, diff --git a/ErsatzTV/Pages/FFmpegEditor.razor b/ErsatzTV/Pages/FFmpegEditor.razor index 018ba79d9..1ef9f9d32 100644 --- a/ErsatzTV/Pages/FFmpegEditor.razor +++ b/ErsatzTV/Pages/FFmpegEditor.razor @@ -63,7 +63,8 @@ + Disabled="@(_model.VideoFormat != FFmpegProfileVideoFormat.H264 || (_model.HardwareAcceleration != HardwareAccelerationKind.Nvenc && _model.HardwareAcceleration != HardwareAccelerationKind.Qsv && _model.HardwareAcceleration != HardwareAccelerationKind.None))" + Clearable="true"> main high