Fix A53 CC SEI breaking H26x_VAAPI hardware encode

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
Nyanmisaka 2023-09-25 22:56:59 +08:00 committed by GitHub
parent 3229d3ba02
commit 99cc1ed13a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,6 +48,7 @@ namespace MediaBrowser.Controller.MediaEncoding
private readonly Version _minFFmpegHwaUnsafeOutput = new Version(6, 0);
private readonly Version _minFFmpegOclCuTonemapMode = new Version(5, 1, 3);
private readonly Version _minFFmpegSvtAv1Params = new Version(5, 1);
private readonly Version _minFFmpegVaapiH26xEncA53CcSei = new Version(6, 0);
private static readonly string[] _videoProfilesH264 = new[]
{
@ -2006,6 +2007,14 @@ namespace MediaBrowser.Controller.MediaEncoding
param += " -svtav1-params:0 rc=1:tune=0:film-grain=0:enable-overlays=1:enable-tf=0";
}
/* Access unit too large: 8192 < 20880 error */
if ((string.Equals(videoEncoder, "h264_vaapi", StringComparison.OrdinalIgnoreCase) ||
string.Equals(videoEncoder, "hevc_vaapi", StringComparison.OrdinalIgnoreCase)) &&
_mediaEncoder.EncoderVersion >= _minFFmpegVaapiH26xEncA53CcSei)
{
param += " -sei -a53_cc";
}
return param;
}