Update transcode_bench.py

This commit is contained in:
2025-10-12 20:29:03 +13:00
parent c2cd7c1589
commit f4c69a1468

View File

@@ -13,6 +13,7 @@ import threading
import argparse
import signal
import atexit
import math
from pathlib import Path
from typing import Optional, Tuple, List
@@ -539,14 +540,13 @@ class Benchmark:
max_streams = 1
# Estimate maximum possible streams based on single stream performance
# If 1 stream achieves X fps, we can theoretically handle X/min_fps streams
# Use 80% of theoretical max to account for overhead
theoretical_max = int((avg_fps / min_fps) * 0.8)
# Upper bound = ceiling(1.2 * X / min_fps)
estimated_max = math.ceil(1.2 * avg_fps / min_fps)
# Cap the search space reasonably
estimated_max = max(2, min(theoretical_max, 128))
# Cap the search space reasonably (at least 2, at most 128)
estimated_max = max(2, min(estimated_max, 128))
print(f"Estimated capacity: ~{theoretical_max} streams (searching up to {estimated_max})")
print(f"Estimated capacity: ~{int(avg_fps / min_fps)} streams (searching up to {estimated_max})")
# Binary search bounds
low, high = 2, estimated_max
@@ -579,8 +579,8 @@ def main():
parser.add_argument(
'--duration',
type=int,
default=30,
help='Test video duration in seconds (default: 30)'
default=10,
help='Test video duration in seconds (default: 10)'
)
parser.add_argument(
'--input',