Update transcode_bench.py

This commit is contained in:
2025-10-12 20:38:18 +13:00
parent a8d2116808
commit ee1ce66af9

View File

@@ -382,8 +382,8 @@ class TranscodeJob:
# Configure encoding parameters based on encoder type
if 'vaapi' in self.hevc_encoder:
# VA-API: use CQP mode
encode_params.extend(['-qp', '23'])
# VA-API: use CQP mode with Main profile (4:2:0)
encode_params.extend(['-profile:v', 'main', '-qp', '23'])
elif self.hevc_encoder == 'libx265':
# Software HEVC: use CRF mode
encode_params.extend(['-preset', 'medium', '-crf', '23'])
@@ -517,11 +517,22 @@ class Benchmark:
cmd2.extend([
'-f', 'rawvideo', '-pix_fmt', 'nv12', '-s:v', '1920x1080', '-i', yuv_file,
'-vf', 'scale=1280x720,format=nv12,hwupload' if 'vaapi' in hw_hevc_encoder else 'scale=1280x720',
'-frames:v', '1', '-c:v', hw_hevc_encoder, '-qp', '23',
'-f', 'null', '-'
'-frames:v', '1', '-c:v', hw_hevc_encoder,
])
# Add profile and quality settings for VA-API HEVC
if 'vaapi' in hw_hevc_encoder:
cmd2.extend(['-profile:v', 'main', '-qp', '23'])
else:
cmd2.extend(['-qp', '23'])
cmd2.extend(['-f', 'null', '-'])
result = subprocess.run(cmd2, capture_output=True, timeout=5)
# Debug output if it fails
if result.returncode != 0:
print(f" Hardware HEVC test failed: {result.stderr.decode()[:200]}")
os.unlink(yuv_file)
if result.returncode == 0: