mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 15:28:23 +00:00
Merge branch 'master' into feature/ffmpeg-version-check
This commit is contained in:
commit
33f78df051
448 changed files with 2976 additions and 906 deletions
|
|
@ -25,7 +25,7 @@ using System.Diagnostics;
|
|||
namespace MediaBrowser.MediaEncoding.Encoder
|
||||
{
|
||||
/// <summary>
|
||||
/// Class MediaEncoder
|
||||
/// Class MediaEncoder.
|
||||
/// </summary>
|
||||
public class MediaEncoder : IMediaEncoder, IDisposable
|
||||
{
|
||||
|
|
@ -111,6 +111,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
|
||||
SetAvailableDecoders(validator.GetDecoders());
|
||||
SetAvailableEncoders(validator.GetEncoders());
|
||||
SetAvailableHwaccels(validator.GetHwaccels());
|
||||
}
|
||||
|
||||
_logger.LogInformation("FFmpeg: {EncoderLocation}: {FfmpegPath}", EncoderLocation, _ffmpegPath ?? string.Empty);
|
||||
|
|
@ -225,6 +226,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
{
|
||||
return inJellyfinPath;
|
||||
}
|
||||
|
||||
var values = Environment.GetEnvironmentVariable("PATH");
|
||||
|
||||
foreach (var path in values.Split(Path.PathSeparator))
|
||||
|
|
@ -254,6 +256,13 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
// _logger.Info("Supported decoders: {0}", string.Join(",", list.ToArray()));
|
||||
}
|
||||
|
||||
private List<string> _hwaccels = new List<string>();
|
||||
public void SetAvailableHwaccels(IEnumerable<string> list)
|
||||
{
|
||||
_hwaccels = list.ToList();
|
||||
//_logger.Info("Supported hwaccels: {0}", string.Join(",", list.ToArray()));
|
||||
}
|
||||
|
||||
public bool SupportsEncoder(string encoder)
|
||||
{
|
||||
return _encoders.Contains(encoder, StringComparer.OrdinalIgnoreCase);
|
||||
|
|
@ -264,6 +273,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
return _decoders.Contains(decoder, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public bool SupportsHwaccel(string hwaccel)
|
||||
{
|
||||
return _hwaccels.Contains(hwaccel, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public bool CanEncodeToAudioCodec(string codec)
|
||||
{
|
||||
if (string.Equals(codec, "opus", StringComparison.OrdinalIgnoreCase))
|
||||
|
|
@ -422,7 +436,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// The us culture
|
||||
/// The us culture.
|
||||
/// </summary>
|
||||
protected readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue