Update transcode_bench.py
This commit is contained in:
@@ -382,8 +382,8 @@ class TranscodeJob:
|
|||||||
|
|
||||||
# Configure encoding parameters based on encoder type
|
# Configure encoding parameters based on encoder type
|
||||||
if 'vaapi' in self.hevc_encoder:
|
if 'vaapi' in self.hevc_encoder:
|
||||||
# VA-API: use CQP mode
|
# VA-API: use CQP mode with Main profile (4:2:0)
|
||||||
encode_params.extend(['-qp', '23'])
|
encode_params.extend(['-profile:v', 'main', '-qp', '23'])
|
||||||
elif self.hevc_encoder == 'libx265':
|
elif self.hevc_encoder == 'libx265':
|
||||||
# Software HEVC: use CRF mode
|
# Software HEVC: use CRF mode
|
||||||
encode_params.extend(['-preset', 'medium', '-crf', '23'])
|
encode_params.extend(['-preset', 'medium', '-crf', '23'])
|
||||||
@@ -517,11 +517,22 @@ class Benchmark:
|
|||||||
cmd2.extend([
|
cmd2.extend([
|
||||||
'-f', 'rawvideo', '-pix_fmt', 'nv12', '-s:v', '1920x1080', '-i', yuv_file,
|
'-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',
|
'-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',
|
'-frames:v', '1', '-c:v', hw_hevc_encoder,
|
||||||
'-f', 'null', '-'
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# 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)
|
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)
|
os.unlink(yuv_file)
|
||||||
|
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
|
Reference in New Issue
Block a user