mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-06 07:48:50 +01:00
Merge pull request #15926 from abitofevrything/feat/accurate_hls_seeking
Refactor HLS transcode seeking
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma warning disable CA1819 // XML serialization handles collections improperly, so we need to use arrays
|
||||
|
||||
#nullable disable
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Model.Configuration;
|
||||
@@ -60,6 +61,7 @@ public class EncodingOptions
|
||||
SubtitleExtractionTimeoutMinutes = 30;
|
||||
AllowOnDemandMetadataBasedKeyframeExtractionForExtensions = ["mkv"];
|
||||
HardwareDecodingCodecs = ["h264", "vc1"];
|
||||
HlsAudioSeekStrategy = HlsAudioSeekStrategy.DisableAccurateSeek;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -301,4 +303,10 @@ public class EncodingOptions
|
||||
/// Gets or sets the file extensions on-demand metadata based keyframe extraction is enabled for.
|
||||
/// </summary>
|
||||
public string[] AllowOnDemandMetadataBasedKeyframeExtractionForExtensions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the method used for audio seeking in HLS.
|
||||
/// </summary>
|
||||
[DefaultValue(HlsAudioSeekStrategy.DisableAccurateSeek)]
|
||||
public HlsAudioSeekStrategy HlsAudioSeekStrategy { get; set; }
|
||||
}
|
||||
|
||||
23
MediaBrowser.Model/Configuration/HlsAudioSeekStrategy.cs
Normal file
23
MediaBrowser.Model/Configuration/HlsAudioSeekStrategy.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace MediaBrowser.Model.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// An enum representing the options to seek the input audio stream when
|
||||
/// transcoding HLS segments.
|
||||
/// </summary>
|
||||
public enum HlsAudioSeekStrategy
|
||||
{
|
||||
/// <summary>
|
||||
/// If the video stream is transcoded and the audio stream is copied,
|
||||
/// seek the video stream to the same keyframe as the audio stream. The
|
||||
/// resulting timestamps in the output streams may be inaccurate.
|
||||
/// </summary>
|
||||
DisableAccurateSeek = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Prevent audio streams from being copied if the video stream is transcoded.
|
||||
/// The resulting timestamps will be accurate, but additional audio transcoding
|
||||
/// overhead will be incurred.
|
||||
/// </summary>
|
||||
TranscodeAudio = 1,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user