commit
d01c79b875
|
@ -179,6 +179,11 @@ namespace Emby.Common.Implementations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual PackageVersionClass SystemUpdateLevel
|
||||||
|
{
|
||||||
|
get { return PackageVersionClass.Release; }
|
||||||
|
}
|
||||||
|
|
||||||
public virtual string OperatingSystemDisplayName
|
public virtual string OperatingSystemDisplayName
|
||||||
{
|
{
|
||||||
get { return EnvironmentInfo.OperatingSystemName; }
|
get { return EnvironmentInfo.OperatingSystemName; }
|
||||||
|
|
|
@ -1366,7 +1366,7 @@ namespace Emby.Server.Core
|
||||||
SupportsLibraryMonitor = true,
|
SupportsLibraryMonitor = true,
|
||||||
EncoderLocationType = MediaEncoder.EncoderLocationType,
|
EncoderLocationType = MediaEncoder.EncoderLocationType,
|
||||||
SystemArchitecture = EnvironmentInfo.SystemArchitecture,
|
SystemArchitecture = EnvironmentInfo.SystemArchitecture,
|
||||||
SystemUpdateLevel = ConfigurationManager.CommonConfiguration.SystemUpdateLevel,
|
SystemUpdateLevel = SystemUpdateLevel,
|
||||||
PackageName = StartupOptions.GetOption("-package")
|
PackageName = StartupOptions.GetOption("-package")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1632,7 +1632,7 @@ namespace Emby.Server.Core
|
||||||
public override async Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress)
|
public override async Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress<double> progress)
|
||||||
{
|
{
|
||||||
var cacheLength = TimeSpan.FromHours(3);
|
var cacheLength = TimeSpan.FromHours(3);
|
||||||
var updateLevel = ConfigurationManager.CommonConfiguration.SystemUpdateLevel;
|
var updateLevel = SystemUpdateLevel;
|
||||||
|
|
||||||
if (updateLevel == PackageVersionClass.Beta)
|
if (updateLevel == PackageVersionClass.Beta)
|
||||||
{
|
{
|
||||||
|
|
|
@ -270,9 +270,14 @@ namespace Emby.Server.Implementations.Updates
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PackageVersionClass GetSystemUpdateLevel()
|
||||||
|
{
|
||||||
|
return _applicationHost.SystemUpdateLevel;
|
||||||
|
}
|
||||||
|
|
||||||
private TimeSpan GetCacheLength()
|
private TimeSpan GetCacheLength()
|
||||||
{
|
{
|
||||||
switch (_config.CommonConfiguration.SystemUpdateLevel)
|
switch (GetSystemUpdateLevel())
|
||||||
{
|
{
|
||||||
case PackageVersionClass.Beta:
|
case PackageVersionClass.Beta:
|
||||||
return TimeSpan.FromMinutes(30);
|
return TimeSpan.FromMinutes(30);
|
||||||
|
@ -424,10 +429,12 @@ namespace Emby.Server.Implementations.Updates
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var systemUpdateLevel = GetSystemUpdateLevel();
|
||||||
|
|
||||||
// Figure out what needs to be installed
|
// Figure out what needs to be installed
|
||||||
var packages = plugins.Select(p =>
|
var packages = plugins.Select(p =>
|
||||||
{
|
{
|
||||||
var latestPluginInfo = GetLatestCompatibleVersion(catalog, p.Name, p.Id.ToString(), applicationVersion, _config.CommonConfiguration.SystemUpdateLevel);
|
var latestPluginInfo = GetLatestCompatibleVersion(catalog, p.Name, p.Id.ToString(), applicationVersion, systemUpdateLevel);
|
||||||
|
|
||||||
return latestPluginInfo != null && GetPackageVersion(latestPluginInfo) > p.Version ? latestPluginInfo : null;
|
return latestPluginInfo != null && GetPackageVersion(latestPluginInfo) > p.Version ? latestPluginInfo : null;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Common.IO;
|
using MediaBrowser.Common.IO;
|
||||||
|
using MediaBrowser.Controller.MediaEncoding;
|
||||||
using MediaBrowser.Controller.Net;
|
using MediaBrowser.Controller.Net;
|
||||||
using MediaBrowser.Model.Diagnostics;
|
using MediaBrowser.Model.Diagnostics;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
|
@ -829,23 +830,4 @@ namespace MediaBrowser.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Enum TranscodingJobType
|
|
||||||
/// </summary>
|
|
||||||
public enum TranscodingJobType
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The progressive
|
|
||||||
/// </summary>
|
|
||||||
Progressive,
|
|
||||||
/// <summary>
|
|
||||||
/// The HLS
|
|
||||||
/// </summary>
|
|
||||||
Hls,
|
|
||||||
/// <summary>
|
|
||||||
/// The dash
|
|
||||||
/// </summary>
|
|
||||||
Dash
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,7 +443,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
||||||
var currentTranscodingIndex = GetCurrentTranscodingIndex(playlistPath, segmentExtension);
|
var currentTranscodingIndex = GetCurrentTranscodingIndex(playlistPath, segmentExtension);
|
||||||
|
|
||||||
// If requested segment is less than transcoding position, we can't transcode backwards, so assume it's ready
|
// If requested segment is less than transcoding position, we can't transcode backwards, so assume it's ready
|
||||||
if (segmentIndex != currentTranscodingIndex)
|
if (segmentIndex < currentTranscodingIndex)
|
||||||
{
|
{
|
||||||
return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false);
|
return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@ -890,6 +890,11 @@ namespace MediaBrowser.Api.Playback.Hls
|
||||||
args += " -copyts";
|
args += " -copyts";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(state.OutputVideoSync))
|
||||||
|
{
|
||||||
|
args += " -vsync " + state.OutputVideoSync;
|
||||||
|
}
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,7 +937,7 @@ namespace MediaBrowser.Api.Playback.Hls
|
||||||
}
|
}
|
||||||
|
|
||||||
var videoCodec = EncodingHelper.GetVideoEncoder(state, ApiEntryPoint.Instance.GetEncodingOptions());
|
var videoCodec = EncodingHelper.GetVideoEncoder(state, ApiEntryPoint.Instance.GetEncodingOptions());
|
||||||
var breakOnNonKeyFrames = state.Request.BreakOnNonKeyFrames && string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase);
|
var breakOnNonKeyFrames = state.EnableBreakOnNonKeyFrames(videoCodec);
|
||||||
|
|
||||||
var breakOnNonKeyFramesArg = breakOnNonKeyFrames ? " -break_non_keyframes 1" : "";
|
var breakOnNonKeyFramesArg = breakOnNonKeyFrames ? " -break_non_keyframes 1" : "";
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Common.IO;
|
using MediaBrowser.Common.IO;
|
||||||
|
using MediaBrowser.Controller.MediaEncoding;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.Services;
|
using MediaBrowser.Model.Services;
|
||||||
|
|
||||||
|
|
|
@ -85,36 +85,42 @@ namespace MediaBrowser.Api.Playback.Hls
|
||||||
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
|
if (codec.Equals("copy", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
// if h264_mp4toannexb is ever added, do not use it for live tv
|
// if h264_mp4toannexb is ever added, do not use it for live tv
|
||||||
if (state.VideoStream != null && EncodingHelper.IsH264(state.VideoStream) && !string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
|
if (state.VideoStream != null && EncodingHelper.IsH264(state.VideoStream) &&
|
||||||
|
!string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
args += " -bsf:v h264_mp4toannexb";
|
args += " -bsf:v h264_mp4toannexb";
|
||||||
}
|
}
|
||||||
args += " -flags -global_header";
|
|
||||||
return args;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
var keyFrameArg = string.Format(" -force_key_frames \"expr:gte(t,n_forced*{0})\"",
|
|
||||||
state.SegmentLength.ToString(UsCulture));
|
|
||||||
|
|
||||||
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
|
||||||
|
|
||||||
var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions();
|
|
||||||
args += " " + EncodingHelper.GetVideoQualityParam(state, codec, encodingOptions, GetDefaultH264Preset()) + keyFrameArg;
|
|
||||||
|
|
||||||
// Add resolution params, if specified
|
|
||||||
if (!hasGraphicalSubs)
|
|
||||||
{
|
{
|
||||||
args += EncodingHelper.GetOutputSizeParam(state, codec);
|
var keyFrameArg = string.Format(" -force_key_frames \"expr:gte(t,n_forced*{0})\"",
|
||||||
}
|
state.SegmentLength.ToString(UsCulture));
|
||||||
|
|
||||||
// This is for internal graphical subs
|
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||||
if (hasGraphicalSubs)
|
|
||||||
{
|
var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions();
|
||||||
args += EncodingHelper.GetGraphicalSubtitleParam(state, codec);
|
args += " " + EncodingHelper.GetVideoQualityParam(state, codec, encodingOptions, GetDefaultH264Preset()) + keyFrameArg;
|
||||||
|
|
||||||
|
// Add resolution params, if specified
|
||||||
|
if (!hasGraphicalSubs)
|
||||||
|
{
|
||||||
|
args += EncodingHelper.GetOutputSizeParam(state, codec);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is for internal graphical subs
|
||||||
|
if (hasGraphicalSubs)
|
||||||
|
{
|
||||||
|
args += EncodingHelper.GetGraphicalSubtitleParam(state, codec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
args += " -flags -global_header";
|
args += " -flags -global_header";
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(state.OutputVideoSync))
|
||||||
|
{
|
||||||
|
args += " -vsync " + state.OutputVideoSync;
|
||||||
|
}
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
public int? SegmentLength { get; set; }
|
public int? SegmentLength { get; set; }
|
||||||
public int? MinSegments { get; set; }
|
public int? MinSegments { get; set; }
|
||||||
public bool BreakOnNonKeyFrames { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class VideoStreamRequest : StreamRequest
|
public class VideoStreamRequest : StreamRequest
|
||||||
|
|
|
@ -104,14 +104,6 @@ namespace MediaBrowser.Api.Playback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsSegmentedLiveStream
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int HlsListSize
|
public int HlsListSize
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -121,14 +113,12 @@ namespace MediaBrowser.Api.Playback
|
||||||
}
|
}
|
||||||
|
|
||||||
public string UserAgent { get; set; }
|
public string UserAgent { get; set; }
|
||||||
public TranscodingJobType TranscodingType { get; set; }
|
|
||||||
|
|
||||||
public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType)
|
public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType)
|
||||||
: base(logger)
|
: base(logger, transcodingType)
|
||||||
{
|
{
|
||||||
_mediaSourceManager = mediaSourceManager;
|
_mediaSourceManager = mediaSourceManager;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
TranscodingType = transcodingType;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string MimeType { get; set; }
|
public string MimeType { get; set; }
|
||||||
|
|
|
@ -157,5 +157,7 @@ namespace MediaBrowser.Common
|
||||||
/// <param name="type">The type.</param>
|
/// <param name="type">The type.</param>
|
||||||
/// <returns>System.Object.</returns>
|
/// <returns>System.Object.</returns>
|
||||||
object CreateInstance(Type type);
|
object CreateInstance(Type type);
|
||||||
|
|
||||||
|
PackageVersionClass SystemUpdateLevel { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -663,11 +663,6 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
param += string.Format(" -r {0}", framerate.Value.ToString(_usCulture));
|
param += string.Format(" -r {0}", framerate.Value.ToString(_usCulture));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(state.OutputVideoSync))
|
|
||||||
{
|
|
||||||
param += " -vsync " + state.OutputVideoSync;
|
|
||||||
}
|
|
||||||
|
|
||||||
var request = state.BaseRequest;
|
var request = state.BaseRequest;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(request.Profile))
|
if (!string.IsNullOrEmpty(request.Profile))
|
||||||
|
@ -1571,10 +1566,14 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
|
||||||
if (state.IsVideoRequest)
|
if (state.IsVideoRequest)
|
||||||
{
|
{
|
||||||
|
var outputVideoCodec = GetVideoEncoder(state, encodingOptions);
|
||||||
|
|
||||||
// Important: If this is ever re-enabled, make sure not to use it with wtv because it breaks seeking
|
// Important: If this is ever re-enabled, make sure not to use it with wtv because it breaks seeking
|
||||||
if (string.Equals(state.OutputContainer, "mkv", StringComparison.OrdinalIgnoreCase) && state.CopyTimestamps)
|
if (!string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
state.TranscodingType != TranscodingJobType.Progressive &&
|
||||||
|
state.EnableBreakOnNonKeyFrames(outputVideoCodec))
|
||||||
{
|
{
|
||||||
//inputModifier += " -noaccurate_seek";
|
inputModifier += " -noaccurate_seek";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(state.InputContainer) && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
|
if (!string.IsNullOrWhiteSpace(state.InputContainer) && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
|
||||||
|
@ -1878,7 +1877,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
|
||||||
if (string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
if (state.VideoStream != null && IsH264(state.VideoStream) && string.Equals(state.OutputContainer, "ts", StringComparison.OrdinalIgnoreCase) && !string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
|
if (state.VideoStream != null && IsH264(state.VideoStream) &&
|
||||||
|
string.Equals(state.OutputContainer, "ts", StringComparison.OrdinalIgnoreCase) &&
|
||||||
|
!string.Equals(state.VideoStream.NalLengthSize, "0", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
args += " -bsf:v h264_mp4toannexb";
|
args += " -bsf:v h264_mp4toannexb";
|
||||||
}
|
}
|
||||||
|
@ -1892,51 +1893,56 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
{
|
{
|
||||||
args += " -flags -global_header -fflags +genpts";
|
args += " -flags -global_header -fflags +genpts";
|
||||||
}
|
}
|
||||||
|
|
||||||
return args;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
var keyFrameArg = string.Format(" -force_key_frames \"expr:gte(t,n_forced*{0})\"",
|
|
||||||
5.ToString(_usCulture));
|
|
||||||
|
|
||||||
args += keyFrameArg;
|
|
||||||
|
|
||||||
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
|
||||||
|
|
||||||
var hasCopyTs = false;
|
|
||||||
// Add resolution params, if specified
|
|
||||||
if (!hasGraphicalSubs)
|
|
||||||
{
|
{
|
||||||
var outputSizeParam = GetOutputSizeParam(state, videoCodec);
|
var keyFrameArg = string.Format(" -force_key_frames \"expr:gte(t,n_forced*{0})\"",
|
||||||
args += outputSizeParam;
|
5.ToString(_usCulture));
|
||||||
hasCopyTs = outputSizeParam.IndexOf("copyts", StringComparison.OrdinalIgnoreCase) != -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.RunTimeTicks.HasValue && state.BaseRequest.CopyTimestamps)
|
args += keyFrameArg;
|
||||||
{
|
|
||||||
if (!hasCopyTs)
|
var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode;
|
||||||
|
|
||||||
|
var hasCopyTs = false;
|
||||||
|
// Add resolution params, if specified
|
||||||
|
if (!hasGraphicalSubs)
|
||||||
{
|
{
|
||||||
args += " -copyts";
|
var outputSizeParam = GetOutputSizeParam(state, videoCodec);
|
||||||
|
args += outputSizeParam;
|
||||||
|
hasCopyTs = outputSizeParam.IndexOf("copyts", StringComparison.OrdinalIgnoreCase) != -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.RunTimeTicks.HasValue && state.BaseRequest.CopyTimestamps)
|
||||||
|
{
|
||||||
|
if (!hasCopyTs)
|
||||||
|
{
|
||||||
|
args += " -copyts";
|
||||||
|
}
|
||||||
|
args += " -avoid_negative_ts disabled -start_at_zero";
|
||||||
|
}
|
||||||
|
|
||||||
|
var qualityParam = GetVideoQualityParam(state, videoCodec, encodingOptions, defaultH264Preset);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(qualityParam))
|
||||||
|
{
|
||||||
|
args += " " + qualityParam.Trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is for internal graphical subs
|
||||||
|
if (hasGraphicalSubs)
|
||||||
|
{
|
||||||
|
args += GetGraphicalSubtitleParam(state, videoCodec);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!state.RunTimeTicks.HasValue)
|
||||||
|
{
|
||||||
|
args += " -flags -global_header";
|
||||||
}
|
}
|
||||||
args += " -avoid_negative_ts disabled -start_at_zero";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var qualityParam = GetVideoQualityParam(state, videoCodec, encodingOptions, defaultH264Preset);
|
if (!string.IsNullOrEmpty(state.OutputVideoSync))
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(qualityParam))
|
|
||||||
{
|
{
|
||||||
args += " " + qualityParam.Trim();
|
args += " -vsync " + state.OutputVideoSync;
|
||||||
}
|
|
||||||
|
|
||||||
// This is for internal graphical subs
|
|
||||||
if (hasGraphicalSubs)
|
|
||||||
{
|
|
||||||
args += GetGraphicalSubtitleParam(state, videoCodec);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!state.RunTimeTicks.HasValue)
|
|
||||||
{
|
|
||||||
args += " -flags -global_header";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
|
|
|
@ -41,7 +41,20 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
|
||||||
public string OutputContainer { get; set; }
|
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 OutputAudioSync = "1";
|
||||||
public string InputAudioSync { get; set; }
|
public string InputAudioSync { get; set; }
|
||||||
public string InputVideoSync { get; set; }
|
public string InputVideoSync { get; set; }
|
||||||
|
@ -72,10 +85,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
public int? OutputAudioSampleRate;
|
public int? OutputAudioSampleRate;
|
||||||
public bool DeInterlace { get; set; }
|
public bool DeInterlace { get; set; }
|
||||||
public bool IsVideoRequest { get; set; }
|
public bool IsVideoRequest { get; set; }
|
||||||
|
public TranscodingJobType TranscodingType { get; set; }
|
||||||
|
|
||||||
public EncodingJobInfo(ILogger logger)
|
public EncodingJobInfo(ILogger logger, TranscodingJobType jobType)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
|
TranscodingType = jobType;
|
||||||
RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
PlayableStreamFileNames = new List<string>();
|
PlayableStreamFileNames = new List<string>();
|
||||||
SupportedAudioCodecs = new List<string>();
|
SupportedAudioCodecs = new List<string>();
|
||||||
|
@ -83,6 +98,29 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
SupportedSubtitleCodecs = new List<string>();
|
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>
|
/// <summary>
|
||||||
/// Predicts the audio sample rate that will be in the output stream
|
/// Predicts the audio sample rate that will be in the output stream
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -118,4 +156,23 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
|
||||||
public abstract void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentComplete, long? bytesTranscoded, int? bitRate);
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
|
||||||
public bool AllowVideoStreamCopy { get; set; }
|
public bool AllowVideoStreamCopy { get; set; }
|
||||||
public bool AllowAudioStreamCopy { get; set; }
|
public bool AllowAudioStreamCopy { get; set; }
|
||||||
|
public bool BreakOnNonKeyFrames { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the audio sample rate.
|
/// Gets or sets the audio sample rate.
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||||
private readonly IMediaSourceManager _mediaSourceManager;
|
private readonly IMediaSourceManager _mediaSourceManager;
|
||||||
|
|
||||||
public EncodingJob(ILogger logger, IMediaSourceManager mediaSourceManager) :
|
public EncodingJob(ILogger logger, IMediaSourceManager mediaSourceManager) :
|
||||||
base(logger)
|
base(logger, TranscodingJobType.Progressive)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_mediaSourceManager = mediaSourceManager;
|
_mediaSourceManager = mediaSourceManager;
|
||||||
|
|
|
@ -12,6 +12,8 @@ using MediaBrowser.IsoMounter;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using MediaBrowser.Model.System;
|
using MediaBrowser.Model.System;
|
||||||
|
using MediaBrowser.Model.Updates;
|
||||||
|
using MediaBrowser.Server.Startup.Common;
|
||||||
|
|
||||||
namespace MediaBrowser.Server.Mono
|
namespace MediaBrowser.Server.Mono
|
||||||
{
|
{
|
||||||
|
@ -40,6 +42,11 @@ namespace MediaBrowser.Server.Mono
|
||||||
return new SyncManager();
|
return new SyncManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override PackageVersionClass SystemUpdateLevel
|
||||||
|
{
|
||||||
|
get { return UpdateLevelHelper.GetSystemUpdateLevel(ConfigurationManager); }
|
||||||
|
}
|
||||||
|
|
||||||
protected override void RestartInternal()
|
protected override void RestartInternal()
|
||||||
{
|
{
|
||||||
MainClass.Restart(StartupOptions);
|
MainClass.Restart(StartupOptions);
|
||||||
|
|
|
@ -77,6 +77,7 @@
|
||||||
<Compile Include="IO\MemoryStreamProvider.cs" />
|
<Compile Include="IO\MemoryStreamProvider.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="SystemEvents.cs" />
|
<Compile Include="SystemEvents.cs" />
|
||||||
|
<Compile Include="UpdateLevelHelper.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Emby.Drawing.ImageMagick\Emby.Drawing.ImageMagick.csproj">
|
<ProjectReference Include="..\Emby.Drawing.ImageMagick\Emby.Drawing.ImageMagick.csproj">
|
||||||
|
|
27
MediaBrowser.Server.Startup.Common/UpdateLevelHelper.cs
Normal file
27
MediaBrowser.Server.Startup.Common/UpdateLevelHelper.cs
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Configuration;
|
||||||
|
using MediaBrowser.Common.Configuration;
|
||||||
|
using MediaBrowser.Model.Updates;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Server.Startup.Common
|
||||||
|
{
|
||||||
|
public static class UpdateLevelHelper
|
||||||
|
{
|
||||||
|
public static PackageVersionClass GetSystemUpdateLevel(IConfigurationManager config)
|
||||||
|
{
|
||||||
|
return config.CommonConfiguration.SystemUpdateLevel;
|
||||||
|
//var configuredValue = ConfigurationManager.AppSettings["SystemUpdateLevel"];
|
||||||
|
|
||||||
|
//if (string.Equals(configuredValue, "Beta", StringComparison.OrdinalIgnoreCase))
|
||||||
|
//{
|
||||||
|
// return PackageVersionClass.Beta;
|
||||||
|
//}
|
||||||
|
//if (string.Equals(configuredValue, "Dev", StringComparison.OrdinalIgnoreCase))
|
||||||
|
//{
|
||||||
|
// return PackageVersionClass.Dev;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//return PackageVersionClass.Release;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,6 +17,8 @@ using MediaBrowser.Controller.Sync;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using MediaBrowser.Model.System;
|
using MediaBrowser.Model.System;
|
||||||
|
using MediaBrowser.Model.Updates;
|
||||||
|
using MediaBrowser.Server.Startup.Common;
|
||||||
using MediaBrowser.ServerApplication.Native;
|
using MediaBrowser.ServerApplication.Native;
|
||||||
|
|
||||||
namespace MediaBrowser.ServerApplication
|
namespace MediaBrowser.ServerApplication
|
||||||
|
@ -53,6 +55,11 @@ namespace MediaBrowser.ServerApplication
|
||||||
LoopUtil.Run(appName);
|
LoopUtil.Run(appName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override PackageVersionClass SystemUpdateLevel
|
||||||
|
{
|
||||||
|
get { return UpdateLevelHelper.GetSystemUpdateLevel(ConfigurationManager); }
|
||||||
|
}
|
||||||
|
|
||||||
protected override List<Assembly> GetAssembliesWithPartsInternal()
|
protected override List<Assembly> GetAssembliesWithPartsInternal()
|
||||||
{
|
{
|
||||||
var list = new List<Assembly>();
|
var list = new List<Assembly>();
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.2.12.1")]
|
[assembly: AssemblyVersion("3.2.12.2")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user