diff options
| author | Cody Robibero <cody@robibe.ro> | 2024-03-18 08:37:02 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-18 08:37:02 -0600 |
| commit | 833bc06eb4e49d86ac8e5140f9a1cd4ef8dce9f5 (patch) | |
| tree | d61a87e423cbb36cea27cd7a511612b7dbb9a6c3 /MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | |
| parent | bd1060b306334eee7f6e3630a75db1cf5deed507 (diff) | |
| parent | 9b35b4e8f28e95fbd583f12e3192da3e8132dae2 (diff) | |
Merge pull request #11161 from nyanmisaka/fix-segment-deletion
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 946f7266c..cdaa6a6cd 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -51,6 +51,7 @@ namespace MediaBrowser.Controller.MediaEncoding private readonly Version _minFFmpegOclCuTonemapMode = new Version(5, 1, 3); private readonly Version _minFFmpegSvtAv1Params = new Version(5, 1); private readonly Version _minFFmpegVaapiH26xEncA53CcSei = new Version(6, 0); + private readonly Version _minFFmpegReadrateOption = new Version(5, 0); private static readonly string[] _videoProfilesH264 = new[] { @@ -1221,7 +1222,7 @@ namespace MediaBrowser.Controller.MediaEncoding // Disable auto inserted SW scaler for HW decoders in case of changed resolution. var isSwDecoder = string.IsNullOrEmpty(GetHardwareVideoDecoder(state, options)); - if (!isSwDecoder && _mediaEncoder.EncoderVersion >= new Version(4, 4)) + if (!isSwDecoder) { arg.Append(" -noautoscale"); } @@ -6393,6 +6394,16 @@ namespace MediaBrowser.Controller.MediaEncoding { inputModifier += " -re"; } + else if (encodingOptions.EnableSegmentDeletion + && state.VideoStream is not null + && state.TranscodingType == TranscodingJobType.Hls + && IsCopyCodec(state.OutputVideoCodec) + && _mediaEncoder.EncoderVersion >= _minFFmpegReadrateOption) + { + // Set an input read rate limit 10x for using SegmentDeletion with stream-copy + // to prevent ffmpeg from exiting prematurely (due to fast drive) + inputModifier += " -readrate 10"; + } var flags = new List<string>(); if (state.IgnoreInputDts) |
