mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-25 19:46:34 +00:00
update display of active recordings
This commit is contained in:
@@ -431,10 +431,10 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
if (state.PlayableStreamFileNames.Count > 0)
|
||||
{
|
||||
return MediaEncoder.GetProbeSizeArgument(state.PlayableStreamFileNames.ToArray(), state.InputProtocol);
|
||||
return MediaEncoder.GetProbeSizeAndAnalyzeDurationArgument(state.PlayableStreamFileNames.ToArray(), state.InputProtocol);
|
||||
}
|
||||
|
||||
return MediaEncoder.GetProbeSizeArgument(new[] { state.MediaPath }, state.InputProtocol);
|
||||
return MediaEncoder.GetProbeSizeAndAnalyzeDurationArgument(new[] { state.MediaPath }, state.InputProtocol);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -26,6 +26,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
return string.Format("\"{0}\"", url);
|
||||
}
|
||||
if (protocol == MediaProtocol.Udp)
|
||||
{
|
||||
var url = inputFiles.First();
|
||||
|
||||
return string.Format("\"{0}\"", url);
|
||||
}
|
||||
|
||||
return GetConcatInputArgument(inputFiles);
|
||||
}
|
||||
@@ -74,9 +80,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
return path.Replace("\"", "\\\"");
|
||||
}
|
||||
|
||||
public static string GetProbeSizeArgument(bool isDvd)
|
||||
public static string GetProbeSizeArgument(int numInputFiles)
|
||||
{
|
||||
return isDvd ? "-probesize 1G -analyzeduration 200M" : "";
|
||||
return numInputFiles > 1 ? "-probesize 1G" : "";
|
||||
}
|
||||
|
||||
public static string GetAnalyzeDurationArgument(int numInputFiles)
|
||||
{
|
||||
return numInputFiles > 1 ? "-analyzeduration 200M" : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,10 +426,24 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
var inputFiles = MediaEncoderHelpers.GetInputArgument(FileSystem, request.InputPath, request.Protocol, request.MountedIso, request.PlayableStreamFileNames);
|
||||
|
||||
var probeSizeArgument = GetProbeSizeArgument(inputFiles, request.Protocol);
|
||||
var probeSize = EncodingUtils.GetProbeSizeArgument(inputFiles.Length);
|
||||
string analyzeDuration;
|
||||
|
||||
if (request.AnalyzeDurationSections > 0)
|
||||
{
|
||||
analyzeDuration = "-analyzeduration " +
|
||||
(request.AnalyzeDurationSections*1000000).ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
analyzeDuration = EncodingUtils.GetAnalyzeDurationArgument(inputFiles.Length);
|
||||
}
|
||||
|
||||
probeSize = probeSize + " " + analyzeDuration;
|
||||
probeSize = probeSize.Trim();
|
||||
|
||||
return GetMediaInfoInternal(GetInputArgument(inputFiles, request.Protocol), request.InputPath, request.Protocol, extractChapters,
|
||||
probeSizeArgument, request.MediaType == DlnaProfileType.Audio, request.VideoType, cancellationToken);
|
||||
probeSize, request.MediaType == DlnaProfileType.Audio, request.VideoType, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -450,9 +464,23 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
/// <param name="inputFiles">The input files.</param>
|
||||
/// <param name="protocol">The protocol.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public string GetProbeSizeArgument(string[] inputFiles, MediaProtocol protocol)
|
||||
public string GetProbeSizeAndAnalyzeDurationArgument(string[] inputFiles, MediaProtocol protocol)
|
||||
{
|
||||
return EncodingUtils.GetProbeSizeArgument(inputFiles.Length > 1);
|
||||
var results = new List<string>();
|
||||
|
||||
var probeSize = EncodingUtils.GetProbeSizeArgument(inputFiles.Length);
|
||||
var analyzeDuration = EncodingUtils.GetAnalyzeDurationArgument(inputFiles.Length);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(probeSize))
|
||||
{
|
||||
results.Add(probeSize);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(analyzeDuration))
|
||||
{
|
||||
results.Add(analyzeDuration);
|
||||
}
|
||||
return string.Join(" ", results.ToArray());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -871,7 +899,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
var args = useIFrame ? string.Format("-i {0}{3} -threads 0 -v quiet -vframes 1 -vf \"{2}{4}\" -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg, thumbnail) :
|
||||
string.Format("-i {0}{3} -threads 0 -v quiet -vframes 1 -vf \"{2}\" -f image2 \"{1}\"", inputPath, tempExtractPath, vf, mapArg);
|
||||
|
||||
var probeSize = GetProbeSizeArgument(new[] { inputPath }, protocol);
|
||||
var probeSize = GetProbeSizeAndAnalyzeDurationArgument(new[] { inputPath }, protocol);
|
||||
|
||||
if (!string.IsNullOrEmpty(probeSize))
|
||||
{
|
||||
@@ -982,7 +1010,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
var args = string.Format("-i {0} -threads 0 -v quiet -vf \"{2}\" -f image2 \"{1}\"", inputArgument, outputPath, vf);
|
||||
|
||||
var probeSize = GetProbeSizeArgument(new[] { inputArgument }, protocol);
|
||||
var probeSize = GetProbeSizeAndAnalyzeDurationArgument(new[] { inputArgument }, protocol);
|
||||
|
||||
if (!string.IsNullOrEmpty(probeSize))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user