aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/BaseStreamingService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index eb80ae89e..dc26218a5 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -317,13 +317,32 @@ namespace MediaBrowser.Api.Playback
}
if (string.Equals(hwType, "vaapi", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(encodingOptions.VaapiDevice))
{
- return GetAvailableEncoder("h264_vaapi", defaultEncoder);
+ if (IsVaapiSupported(state))
+ {
+ return GetAvailableEncoder("h264_vaapi", 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)
{
if (MediaEncoder.SupportsEncoder(preferredEncoder))