Fixes to performance

This commit is contained in:
2026-05-12 19:49:15 +02:00
parent ff47ffea8f
commit 41d96501b6
2 changed files with 33 additions and 25 deletions
+5
View File
@@ -303,6 +303,11 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
"""Build the complete FFmpeg command as a list of arguments."""
cmd = ["ffmpeg", "-y"] # -y to overwrite output
# 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"])
# Resolve paths to absolute
project_path = plan.project_path.resolve()
output_path = output_path.resolve()