mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-26 07:28:43 +02:00
exclude mpeg4 with level -99 from vaapi
This commit is contained in:
parent
b1f604b5e7
commit
ccaf2f43a6
|
@ -316,14 +316,33 @@ namespace MediaBrowser.Api.Playback
|
||||||
return GetAvailableEncoder("h264_omx", defaultEncoder);
|
return GetAvailableEncoder("h264_omx", defaultEncoder);
|
||||||
}
|
}
|
||||||
if (string.Equals(hwType, "vaapi", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(encodingOptions.VaapiDevice))
|
if (string.Equals(hwType, "vaapi", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(encodingOptions.VaapiDevice))
|
||||||
|
{
|
||||||
|
if (IsVaapiSupported(state))
|
||||||
{
|
{
|
||||||
return GetAvailableEncoder("h264_vaapi", defaultEncoder);
|
return GetAvailableEncoder("h264_vaapi", defaultEncoder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return defaultEncoder;
|
return defaultEncoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool IsVaapiSupported(StreamState state)
|
||||||
|
{
|
||||||
|
var videoStream = state.VideoStream;
|
||||||
|
|
||||||
|
if (videoStream != null)
|
||||||
|
{
|
||||||
|
// vaapi will throw an error with this input
|
||||||
|
// [vaapi @ 0x7faed8000960] No VAAPI support for codec mpeg4 profile -99.
|
||||||
|
if (string.Equals(videoStream.Codec, "mpeg4", StringComparison.OrdinalIgnoreCase) && videoStream.Level == -99)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private string GetAvailableEncoder(string preferredEncoder, string defaultEncoder)
|
private string GetAvailableEncoder(string preferredEncoder, string defaultEncoder)
|
||||||
{
|
{
|
||||||
if (MediaEncoder.SupportsEncoder(preferredEncoder))
|
if (MediaEncoder.SupportsEncoder(preferredEncoder))
|
||||||
|
|
|
@ -587,14 +587,33 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||||
return GetAvailableEncoder(mediaEncoder, "h264_omx", defaultEncoder);
|
return GetAvailableEncoder(mediaEncoder, "h264_omx", defaultEncoder);
|
||||||
}
|
}
|
||||||
if (string.Equals(hwType, "vaapi", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(options.VaapiDevice))
|
if (string.Equals(hwType, "vaapi", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(options.VaapiDevice))
|
||||||
|
{
|
||||||
|
if (IsVaapiSupported(state))
|
||||||
{
|
{
|
||||||
return GetAvailableEncoder(mediaEncoder, "h264_vaapi", defaultEncoder);
|
return GetAvailableEncoder(mediaEncoder, "h264_vaapi", defaultEncoder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return defaultEncoder;
|
return defaultEncoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsVaapiSupported(EncodingJob state)
|
||||||
|
{
|
||||||
|
var videoStream = state.VideoStream;
|
||||||
|
|
||||||
|
if (videoStream != null)
|
||||||
|
{
|
||||||
|
// vaapi will throw an error with this input
|
||||||
|
// [vaapi @ 0x7faed8000960] No VAAPI support for codec mpeg4 profile -99.
|
||||||
|
if (string.Equals(videoStream.Codec, "mpeg4", StringComparison.OrdinalIgnoreCase) && videoStream.Level == -99)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
internal static bool CanStreamCopyVideo(EncodingJobOptions request, MediaStream videoStream)
|
internal static bool CanStreamCopyVideo(EncodingJobOptions request, MediaStream videoStream)
|
||||||
{
|
{
|
||||||
if (videoStream.IsInterlaced)
|
if (videoStream.IsInterlaced)
|
||||||
|
|
|
@ -1947,7 +1947,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
timers = timers.Where(i => !(i.Item1.Status == RecordingStatus.New));
|
timers = timers.Where(i => i.Item1.Status != RecordingStatus.New);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue