fix(transcode): conditionally fix VAAPI filter order for HEVC (tested on Haswel) l

Places 'format=nv12' before 'hwupload' in the VAAPI video filter chain only when the input codec is HEVC and hardware decoding is disabled. This resolves filtergraph/driver issues observed on Intel Haswell GPUs when transcoding HEVC->H.264 VAAPI via software decode, ensuring the encoder receives the expected NV12 surface. Retains default filter logic for other codecs. Addresses issues discussed in GitHub issue #18103
pull/18111/head
Andre Sichelero 2025-05-05 21:03:02 -03:00 committed by mertalev
parent 0f2fe656db
commit e623fbfa7a
No known key found for this signature in database
GPG Key ID: DF6ABC77AAD98C95
1 changed files with 6 additions and 1 deletions

View File

@ -802,7 +802,12 @@ export class VaapiSwDecodeConfig extends BaseHWConfig {
getFilterOptions(videoStream: VideoStreamInfo) {
const options = this.getToneMapping(videoStream);
options.push('hwupload=extra_hw_frames=64');
if (videoStream.codecName === VideoCodec.HEVC) {
options.push('format=nv12');
options.push('hwupload=extra_hw_frames=64');
} else {
options.push('hwupload=extra_hw_frames=64');
}
if (this.shouldScale(videoStream)) {
options.push(`scale_vaapi=${this.getScaling(videoStream)}:mode=hq:out_range=pc:format=nv12`);
}