Fixes to performance
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user