mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-24 11:06:56 +00:00
Rebase
This commit is contained in:
@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using MediaBrowser.Model.Diagnostics;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -105,7 +105,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
OnTranscodeBeginning(encodingJob);
|
||||
|
||||
var commandLineLogMessage = process.StartInfo.FileName + " " + process.StartInfo.Arguments;
|
||||
Logger.Info(commandLineLogMessage);
|
||||
Logger.LogInformation(commandLineLogMessage);
|
||||
|
||||
var logFilePath = Path.Combine(ConfigurationManager.CommonApplicationPaths.LogDirectoryPath, "transcode-" + Guid.NewGuid() + ".txt");
|
||||
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(logFilePath));
|
||||
@@ -124,7 +124,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error starting ffmpeg", ex);
|
||||
Logger.LogError("Error starting ffmpeg", ex);
|
||||
|
||||
OnTranscodeFailedToStart(encodingJob.OutputFilePath, encodingJob);
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
private void Cancel(IProcess process, EncodingJob job)
|
||||
{
|
||||
Logger.Info("Killing ffmpeg process for {0}", job.OutputFilePath);
|
||||
Logger.LogInformation("Killing ffmpeg process for {0}", job.OutputFilePath);
|
||||
|
||||
//process.Kill();
|
||||
process.StandardInput.WriteLine("q");
|
||||
@@ -167,7 +167,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
job.HasExited = true;
|
||||
|
||||
Logger.Debug("Disposing stream resources");
|
||||
Logger.LogDebug("Disposing stream resources");
|
||||
job.Dispose();
|
||||
|
||||
var isSuccesful = false;
|
||||
@@ -175,13 +175,13 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
try
|
||||
{
|
||||
var exitCode = process.ExitCode;
|
||||
Logger.Info("FFMpeg exited with code {0}", exitCode);
|
||||
Logger.LogInformation("FFMpeg exited with code {0}", exitCode);
|
||||
|
||||
isSuccesful = exitCode == 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logger.Error("FFMpeg exited with an error.");
|
||||
Logger.LogError("FFMpeg exited with an error.");
|
||||
}
|
||||
|
||||
if (isSuccesful && !job.IsCancelled)
|
||||
@@ -231,7 +231,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// Logger.ErrorException("Error disposing ffmpeg.", ex);
|
||||
// Logger.LogError("Error disposing ffmpeg.", ex);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Model.Diagnostics;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
@@ -20,12 +20,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
public Tuple<List<string>, List<string>> Validate(string encoderPath)
|
||||
{
|
||||
_logger.Info("Validating media encoder at {0}", encoderPath);
|
||||
_logger.LogInformation("Validating media encoder at {0}", encoderPath);
|
||||
|
||||
var decoders = GetDecoders(encoderPath);
|
||||
var encoders = GetEncoders(encoderPath);
|
||||
|
||||
_logger.Info("Encoder validation complete");
|
||||
_logger.LogInformation("Encoder validation complete");
|
||||
|
||||
return new Tuple<List<string>, List<string>>(decoders, encoders);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
if (logOutput)
|
||||
{
|
||||
_logger.ErrorException("Error validating encoder", ex);
|
||||
_logger.LogError("Error validating encoder", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
return false;
|
||||
}
|
||||
|
||||
_logger.Info("ffmpeg info: {0}", output);
|
||||
_logger.LogInformation("ffmpeg info: {0}", output);
|
||||
|
||||
if (output.IndexOf("Libav developers", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception )
|
||||
{
|
||||
//_logger.ErrorException("Error detecting available decoders", ex);
|
||||
//_logger.LogError("Error detecting available decoders", ex);
|
||||
}
|
||||
|
||||
var found = new List<string>();
|
||||
@@ -107,7 +107,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
if (output.IndexOf(srch, StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
_logger.Info("Decoder available: " + codec);
|
||||
_logger.LogInformation("Decoder available: " + codec);
|
||||
found.Add(codec);
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
if (index < required.Length - 1)
|
||||
{
|
||||
_logger.Info("Encoder available: " + codec);
|
||||
_logger.LogInformation("Encoder available: " + codec);
|
||||
}
|
||||
|
||||
found.Add(codec);
|
||||
@@ -187,7 +187,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
RedirectStandardOutput = true
|
||||
});
|
||||
|
||||
_logger.Info("Running {0} {1}", path, arguments);
|
||||
_logger.LogInformation("Running {0} {1}", path, arguments);
|
||||
|
||||
using (process)
|
||||
{
|
||||
@@ -199,7 +199,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.Info("Killing process {0} {1}", path, arguments);
|
||||
_logger.LogInformation("Killing process {0} {1}", path, arguments);
|
||||
|
||||
// Hate having to do this
|
||||
try
|
||||
@@ -208,7 +208,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
_logger.ErrorException("Error killing process", ex1);
|
||||
_logger.LogError("Error killing process", ex1);
|
||||
}
|
||||
|
||||
throw;
|
||||
|
||||
@@ -5,7 +5,6 @@ using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Net;
|
||||
using System;
|
||||
@@ -14,6 +13,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
@@ -81,7 +81,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error disposing log stream", ex);
|
||||
_logger.LogError("Error disposing log stream", ex);
|
||||
}
|
||||
|
||||
LogFileStream = null;
|
||||
@@ -98,7 +98,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error closing media source", ex);
|
||||
_logger.LogError("Error closing media source", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -10,7 +10,7 @@ using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.Progress;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Encoder
|
||||
@@ -72,12 +72,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
catch (HttpException ex)
|
||||
{
|
||||
// Don't let the server crash because of this
|
||||
_logger.ErrorException("Error downloading ffmpeg font files", ex);
|
||||
_logger.LogError("Error downloading ffmpeg font files", ex);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Don't let the server crash because of this
|
||||
_logger.ErrorException("Error writing ffmpeg font files", ex);
|
||||
_logger.LogError("Error writing ffmpeg font files", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
catch (IOException ex)
|
||||
{
|
||||
// Log this, but don't let it fail the operation
|
||||
_logger.ErrorException("Error copying file", ex);
|
||||
_logger.LogError("Error copying file", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
catch (Exception ex)
|
||||
{
|
||||
// The core can function without the font file, so handle this
|
||||
_logger.ErrorException("Failed to download ffmpeg font file from {0}", ex, url);
|
||||
_logger.LogError("Failed to download ffmpeg font file from {0}", ex, url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,12 +145,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
catch (IOException ex)
|
||||
{
|
||||
// Log this, but don't let it fail the operation
|
||||
_logger.ErrorException("Error deleting temp file {0}", ex, tempFile);
|
||||
_logger.LogError("Error deleting temp file {0}", ex, tempFile);
|
||||
}
|
||||
}
|
||||
private void Extract7zArchive(string archivePath, string targetPath)
|
||||
{
|
||||
_logger.Info("Extracting {0} to {1}", archivePath, targetPath);
|
||||
_logger.LogInformation("Extracting {0} to {1}", archivePath, targetPath);
|
||||
|
||||
_zipClient.ExtractAllFrom7z(archivePath, targetPath, true);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
@@ -25,6 +24,7 @@ using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.Diagnostics;
|
||||
using MediaBrowser.Model.System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
@@ -117,7 +117,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error setting FFREPORT environment variable", ex);
|
||||
_logger.LogError("Error setting FFREPORT environment variable", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//_logger.ErrorException("Error setting FFREPORT environment variable", ex);
|
||||
//_logger.LogError("Error setting FFREPORT environment variable", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error setting FFREPORT environment variable", ex);
|
||||
_logger.LogError("Error setting FFREPORT environment variable", ex);
|
||||
}
|
||||
try
|
||||
{
|
||||
@@ -153,7 +153,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error setting FFREPORT environment variable", ex);
|
||||
_logger.LogError("Error setting FFREPORT environment variable", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
return;
|
||||
}
|
||||
|
||||
_logger.Info("Attempting to update encoder path to {0}. pathType: {1}", path ?? string.Empty, pathType ?? string.Empty);
|
||||
_logger.LogInformation("Attempting to update encoder path to {0}. pathType: {1}", path ?? string.Empty, pathType ?? string.Empty);
|
||||
|
||||
Tuple<string, string> newPaths;
|
||||
|
||||
@@ -414,8 +414,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
private void LogPaths()
|
||||
{
|
||||
_logger.Info("FFMpeg: {0}", FFMpegPath ?? "not found");
|
||||
_logger.Info("FFProbe: {0}", FFProbePath ?? "not found");
|
||||
_logger.LogInformation("FFMpeg: {0}", FFMpegPath ?? "not found");
|
||||
_logger.LogInformation("FFProbe: {0}", FFProbePath ?? "not found");
|
||||
}
|
||||
|
||||
private EncodingOptions GetEncodingOptions()
|
||||
@@ -557,11 +557,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
|
||||
if (forceEnableLogging)
|
||||
{
|
||||
_logger.Info("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
_logger.LogInformation("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
_logger.LogDebug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
}
|
||||
|
||||
using (var processWrapper = new ProcessWrapper(process, this, _logger))
|
||||
@@ -651,7 +651,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logger.Error("I-frame image extraction failed, will attempt standard way. Input: {0}", inputArgument);
|
||||
_logger.LogError("I-frame image extraction failed, will attempt standard way. Input: {0}", inputArgument);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,7 +755,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
ErrorDialog = false
|
||||
});
|
||||
|
||||
_logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
_logger.LogDebug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
|
||||
|
||||
using (var processWrapper = new ProcessWrapper(process, this, _logger))
|
||||
{
|
||||
@@ -783,7 +783,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
var msg = string.Format("ffmpeg image extraction failed for {0}", inputPath);
|
||||
|
||||
_logger.Error(msg);
|
||||
_logger.LogError(msg);
|
||||
|
||||
throw new Exception(msg);
|
||||
}
|
||||
@@ -877,7 +877,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
ErrorDialog = false
|
||||
});
|
||||
|
||||
_logger.Info(process.StartInfo.FileName + " " + process.StartInfo.Arguments);
|
||||
_logger.LogInformation(process.StartInfo.FileName + " " + process.StartInfo.Arguments);
|
||||
|
||||
await resourcePool.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -929,7 +929,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
var msg = string.Format("ffmpeg image extraction failed for {0}", inputArgument);
|
||||
|
||||
_logger.Error(msg);
|
||||
_logger.LogError(msg);
|
||||
|
||||
throw new Exception(msg);
|
||||
}
|
||||
@@ -961,7 +961,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
IProgress<double> progress,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Error("EncodeVideo");
|
||||
_logger.LogError("EncodeVideo");
|
||||
var job = await new VideoEncoder(this,
|
||||
_logger,
|
||||
ConfigurationManager,
|
||||
@@ -999,18 +999,18 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error("Error in WaitForExit", ex);
|
||||
_logger.LogError("Error in WaitForExit", ex);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_logger.Info("Killing ffmpeg process");
|
||||
_logger.LogInformation("Killing ffmpeg process");
|
||||
|
||||
process.Process.Kill();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error killing process", ex);
|
||||
_logger.LogError("Error killing process", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using MediaBrowser.Controller.MediaEncoding;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
@@ -63,4 +63,4 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user