diff --git a/CHANGELOG.md b/CHANGELOG.md index 22dffa159..3875194ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Move dark/light mode toggle to **Settings** > **UI** - Use latest (non-deprecated) authorization method with Jellyfin API - Replace direct Discord links with new contact page https://ersatztv.org/contact which also includes other options like Matrix +- Lower GOP size and keyframe interval from four seconds to two seconds in accordance with HLS2 draft spec recommendations ### Fixed - Improve stability of playback orders `Shuffle` and `Shuffle in Order` over time diff --git a/ErsatzTV.FFmpeg/OutputFormat/OutputFormatConcatHls.cs b/ErsatzTV.FFmpeg/OutputFormat/OutputFormatConcatHls.cs index c79bfb483..8d61f10bf 100644 --- a/ErsatzTV.FFmpeg/OutputFormat/OutputFormatConcatHls.cs +++ b/ErsatzTV.FFmpeg/OutputFormat/OutputFormatConcatHls.cs @@ -32,8 +32,8 @@ public class OutputFormatConcatHls : IPipelineStep return [ - "-g", $"{OutputFormatHls.SegmentSeconds}/2", - "-force_key_frames", $"expr:gte(t,n_forced*{OutputFormatHls.SegmentSeconds}/2)", + "-g", $"{OutputFormatHls.KeyframeIntervalSeconds}", + "-force_key_frames", $"expr:gte(t,n_forced*{OutputFormatHls.KeyframeIntervalSeconds})", "-f", "hls", "-hls_segment_type", segmentType, //"-hls_init_time", "2", diff --git a/ErsatzTV.FFmpeg/OutputFormat/OutputFormatHls.cs b/ErsatzTV.FFmpeg/OutputFormat/OutputFormatHls.cs index d8d624db6..805364f30 100644 --- a/ErsatzTV.FFmpeg/OutputFormat/OutputFormatHls.cs +++ b/ErsatzTV.FFmpeg/OutputFormat/OutputFormatHls.cs @@ -6,6 +6,7 @@ namespace ErsatzTV.FFmpeg.OutputFormat; public class OutputFormatHls : IPipelineStep { public const int SegmentSeconds = 4; + public const int KeyframeIntervalSeconds = 2; private readonly FrameState _desiredState; private readonly bool _isFirstTranscode; @@ -55,7 +56,7 @@ public class OutputFormatHls : IPipelineStep int gop = _oneSecondGop ? (int)Math.Round(frameRate.ParsedFrameRate) - : (int)Math.Round(frameRate.ParsedFrameRate * SegmentSeconds); + : (int)Math.Round(frameRate.ParsedFrameRate * KeyframeIntervalSeconds); List result = []; @@ -64,8 +65,8 @@ public class OutputFormatHls : IPipelineStep result.AddRange( [ "-g", $"{gop}", - "-keyint_min", $"{(int)Math.Round(frameRate.ParsedFrameRate * SegmentSeconds)}", - "-force_key_frames", $"expr:gte(t,n_forced*{SegmentSeconds})" + "-keyint_min", $"{(int)Math.Round(frameRate.ParsedFrameRate * KeyframeIntervalSeconds)}", + "-force_key_frames", $"expr:gte(t,n_forced*{KeyframeIntervalSeconds})" ]); } diff --git a/ErsatzTV/Pages/FFmpegEditor.razor b/ErsatzTV/Pages/FFmpegEditor.razor index 1fba702e0..76689a301 100644 --- a/ErsatzTV/Pages/FFmpegEditor.razor +++ b/ErsatzTV/Pages/FFmpegEditor.razor @@ -282,7 +282,14 @@
Format
- + @{ + string helperText = string.Empty; + if (_model.AudioFormat is FFmpegProfileAudioFormat.AacLatm) + { + helperText = "aac (latm) is ONLY intended for DVB-C; anything else should use aac instead which uses ADTS"; + } + } + aac ac3 aac (latm)