Adding performance tuning

This commit is contained in:
2026-05-12 20:22:05 +02:00
parent 4a24d3987f
commit 60e2f20b0f
3 changed files with 45 additions and 5 deletions
+3 -1
View File
@@ -306,7 +306,9 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
# Global thread limits before any -i. Without this, each format=rgba conversion
# in the filter graph (one per video layer) spawns one swscaler thread per CPU core,
# causing OOM on Apple Silicon where av_cpu_count() returns 10-11.
cmd.extend(["-threads", "1", "-filter_threads", "1"])
from .cache import get_ffmpeg_thread_count
_tc = str(get_ffmpeg_thread_count())
cmd.extend(["-threads", _tc, "-filter_threads", _tc])
# Resolve paths to absolute
project_path = plan.project_path.resolve()