Update transcode_bench.py
This commit is contained in:
@@ -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:
|
||||
if self.hw_decode:
|
||||
# HW decode: download from GPU, scale on CPU, upload back
|
||||
# (GPU scaling not widely supported, so use CPU)
|
||||
vf_filters.append('hwdownload')
|
||||
vf_filters.append('format=nv12')
|
||||
|
||||
# Scale on CPU (works everywhere)
|
||||
vf_filters.append('scale=1280x720')
|
||||
# Handle decode format conversion and scaling
|
||||
if self.hw_decode:
|
||||
# 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)])
|
||||
|
Reference in New Issue
Block a user