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 
This commit is contained in:
Andre Sichelero 2025-05-05 21:03:02 -03:00
parent f34f83e164
commit 62c128d1fb

View file

@ -781,7 +781,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`);
}