mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-02-22 04:22:50 +00:00
update vsync
This commit is contained in:
@@ -41,7 +41,20 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
public string OutputContainer { get; set; }
|
||||
|
||||
public string OutputVideoSync = "-1";
|
||||
public string OutputVideoSync
|
||||
{
|
||||
get
|
||||
{
|
||||
// For live tv + recordings
|
||||
if (string.Equals(InputContainer, "mpegts", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(InputContainer, "ts", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "cfr";
|
||||
}
|
||||
|
||||
return "-1";
|
||||
}
|
||||
}
|
||||
public string OutputAudioSync = "1";
|
||||
public string InputAudioSync { get; set; }
|
||||
public string InputVideoSync { get; set; }
|
||||
@@ -72,10 +85,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
public int? OutputAudioSampleRate;
|
||||
public bool DeInterlace { get; set; }
|
||||
public bool IsVideoRequest { get; set; }
|
||||
public TranscodingJobType TranscodingType { get; set; }
|
||||
|
||||
public EncodingJobInfo(ILogger logger)
|
||||
public EncodingJobInfo(ILogger logger, TranscodingJobType jobType)
|
||||
{
|
||||
_logger = logger;
|
||||
TranscodingType = jobType;
|
||||
RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
PlayableStreamFileNames = new List<string>();
|
||||
SupportedAudioCodecs = new List<string>();
|
||||
@@ -83,6 +98,29 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
SupportedSubtitleCodecs = new List<string>();
|
||||
}
|
||||
|
||||
public bool IsSegmentedLiveStream
|
||||
{
|
||||
get
|
||||
{
|
||||
return TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue;
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnableBreakOnNonKeyFrames(string videoCodec)
|
||||
{
|
||||
if (TranscodingType != TranscodingJobType.Progressive)
|
||||
{
|
||||
if (IsSegmentedLiveStream)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return BaseRequest.BreakOnNonKeyFrames && string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Predicts the audio sample rate that will be in the output stream
|
||||
/// </summary>
|
||||
@@ -118,4 +156,23 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
public abstract void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentComplete, long? bytesTranscoded, int? bitRate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enum TranscodingJobType
|
||||
/// </summary>
|
||||
public enum TranscodingJobType
|
||||
{
|
||||
/// <summary>
|
||||
/// The progressive
|
||||
/// </summary>
|
||||
Progressive,
|
||||
/// <summary>
|
||||
/// The HLS
|
||||
/// </summary>
|
||||
Hls,
|
||||
/// <summary>
|
||||
/// The dash
|
||||
/// </summary>
|
||||
Dash
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user