mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 22:43:07 +03:00
Trickplay generation, manager, storage
This commit is contained in:
@@ -149,6 +149,36 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return defaultEncoder;
|
||||
}
|
||||
|
||||
private string GetMjpegEncoder(EncodingJobInfo state, EncodingOptions encodingOptions)
|
||||
{
|
||||
var defaultEncoder = "mjpeg";
|
||||
|
||||
if (state.VideoType == VideoType.VideoFile)
|
||||
{
|
||||
var hwType = encodingOptions.HardwareAccelerationType;
|
||||
|
||||
var codecMap = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
{ "vaapi", defaultEncoder + "_vaapi" },
|
||||
{ "qsv", defaultEncoder + "_qsv" }
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(hwType)
|
||||
&& encodingOptions.EnableHardwareEncoding
|
||||
&& codecMap.ContainsKey(hwType))
|
||||
{
|
||||
var preferredEncoder = codecMap[hwType];
|
||||
|
||||
if (_mediaEncoder.SupportsEncoder(preferredEncoder))
|
||||
{
|
||||
return preferredEncoder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return defaultEncoder;
|
||||
}
|
||||
|
||||
private bool IsVaapiSupported(EncodingJobInfo state)
|
||||
{
|
||||
// vaapi will throw an error with this input
|
||||
@@ -277,6 +307,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return GetH264Encoder(state, encodingOptions);
|
||||
}
|
||||
|
||||
if (string.Equals(codec, "mjpeg", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return GetMjpegEncoder(state, encodingOptions);
|
||||
}
|
||||
|
||||
if (string.Equals(codec, "vp8", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(codec, "vpx", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user