Update transcode_bench.py

This commit is contained in:
2025-10-12 20:40:06 +13:00
parent ee1ce66af9
commit 63666c89f7

View File

@@ -358,21 +358,19 @@ class TranscodeJob:
# Build video filter chain for realistic transcoding
vf_filters = []
# For VA-API, we need to scale and upload to hardware
if 'vaapi' in self.encoder:
# Handle decode format conversion and scaling
if self.hw_decode:
# HW decode: download from GPU, scale on CPU, upload back
# (GPU scaling not widely supported, so use CPU)
# HW decode: download from GPU to CPU first
vf_filters.append('hwdownload')
vf_filters.append('format=nv12')
# Scale on CPU (works everywhere)
vf_filters.append('scale=1280x720')
vf_filters.append('format=nv12')
# Upload to GPU only if HEVC encoder is hardware-accelerated
if 'vaapi' in self.hevc_encoder:
vf_filters.append('hwupload')
else:
# Other encoders: just scale
vf_filters.append('scale=1280x720')
if vf_filters:
cmd.extend(['-vf', ','.join(vf_filters)])