mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-08 12:28:19 +02:00
add support for AMF hardware encoding on Linux.
1) h264_amf is now supported on linux with 'amdgpu-pro' installed and '--enable-amf' when compiling ffmpeg. 2) Using vaapi decode and h264_amf encode on linux platform can avoid some weird transcoding errors in h264_vaapi with amd gpu.
This commit is contained in:
parent
e95239e281
commit
08c4d3797f
1 changed files with 4 additions and 15 deletions
|
@ -2642,22 +2642,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
else
|
else
|
||||||
return "-hwaccel dxva2";
|
return "-hwaccel dxva2";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
switch (videoStream.Codec.ToLowerInvariant())
|
|
||||||
{
|
{
|
||||||
case "avc":
|
//h264_amf is now supported on linux with 'amdgpu-pro' installed and '--enable-amf' when compiling ffmpeg
|
||||||
case "h264":
|
//using vaapi decode and h264_amf encode on linux platform can avoid some weird transcoding errors in h264_vaapi with amd gpu
|
||||||
if (_mediaEncoder.SupportsDecoder("h264_amf") && encodingOptions.HardwareDecodingCodecs.Contains("h264", StringComparer.OrdinalIgnoreCase))
|
return "-hwaccel vaapi";
|
||||||
{
|
|
||||||
return "-c:v h264_amf";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "mpeg2video":
|
|
||||||
if (_mediaEncoder.SupportsDecoder("hevc_amf") && encodingOptions.HardwareDecodingCodecs.Contains("mpeg2video", StringComparer.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
return "-c:v mpeg2_mmal";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue