fix: updated hardware scale filters to explicitly output 8-bit format (nv12), removed conflicting -pix_fmt flag
This commit is contained in:
@@ -400,12 +400,13 @@ class TranscodeSession extends EventEmitter {
|
|||||||
if (upscaleMethod === 'hardware' || !useUpscale) {
|
if (upscaleMethod === 'hardware' || !useUpscale) {
|
||||||
switch (encoder) {
|
switch (encoder) {
|
||||||
case 'nvenc':
|
case 'nvenc':
|
||||||
// NVIDIA CUDA scaling with Lanczos for upscaling
|
// NVIDIA CUDA scaling with Lanczos
|
||||||
return `scale_cuda=-2:${height}:interp_algo=lanczos`;
|
// Force nv12 (8-bit) output to handle 10-bit inputs (fixes "10 bit encode not supported")
|
||||||
|
return `scale_cuda=-2:${height}:interp_algo=lanczos:format=nv12`;
|
||||||
case 'vaapi':
|
case 'vaapi':
|
||||||
return `scale_vaapi=w=-2:h=${height}:format=nv12`;
|
return `scale_vaapi=w=-2:h=${height}:format=nv12`;
|
||||||
case 'qsv':
|
case 'qsv':
|
||||||
return `scale_qsv=w=-2:h=${height}`;
|
return `scale_qsv=w=-2:h=${height}:format=nv12`;
|
||||||
case 'amf':
|
case 'amf':
|
||||||
// AMF uses CPU decode, so use software scale
|
// AMF uses CPU decode, so use software scale
|
||||||
return useUpscale ? `scale=-2:${height}:flags=lanczos` : `scale=-2:${height}`;
|
return useUpscale ? `scale=-2:${height}:flags=lanczos` : `scale=-2:${height}`;
|
||||||
@@ -433,8 +434,7 @@ class TranscodeSession extends EventEmitter {
|
|||||||
'-preset', 'p4', // Balanced preset (p1=fastest, p7=best)
|
'-preset', 'p4', // Balanced preset (p1=fastest, p7=best)
|
||||||
'-rc', 'constqp', // Constant QP mode
|
'-rc', 'constqp', // Constant QP mode
|
||||||
'-qp', String(qp),
|
'-qp', String(qp),
|
||||||
'-bf', '3', // B-frames for better compression
|
'-bf', '3' // B-frames for better compression
|
||||||
'-pix_fmt', 'yuv420p' // Force 8-bit output for compatibility
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user