Fix encoding profile handling for vaapi

This commit is contained in:
Mathieu Velten 2018-12-16 17:36:08 +01:00
parent da16de48aa
commit 060eb98cc5

View File

@ -760,14 +760,18 @@ namespace MediaBrowser.Controller.MediaEncoding
var request = state.BaseRequest;
var profile = state.GetRequestedProfiles(targetVideoCodec).FirstOrDefault();
if (string.Equals(videoEncoder, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
// vaapi does not support Baseline profile, force Constrained Baseline in this case,
// which is compatible (and ugly)
if (string.Equals(videoEncoder, "h264_vaapi", StringComparison.OrdinalIgnoreCase) &&
profile != null && profile.ToLower().Contains("baseline"))
{
param += " -profile:v 578";
profile = "constrained_baseline";
}
else if (!string.IsNullOrEmpty(profile))
if (!string.IsNullOrEmpty(profile))
{
if (!string.Equals(videoEncoder, "h264_omx", StringComparison.OrdinalIgnoreCase) &&
!string.Equals(videoEncoder, "h264_vaapi", StringComparison.OrdinalIgnoreCase) &&
!string.Equals(videoEncoder, "h264_v4l2m2m", StringComparison.OrdinalIgnoreCase))
{
// not supported by h264_omx