perf(engine): write PNG frames at compression_level 1 (#1898)

Extracted video frames are render-scoped temp files read once during
capture, so zlib effort above level 1 buys nothing. Measured 3.3x
faster on 60s of 1080p H.264 to PNG (11.4s to 3.5s) and 5.4x on a 20s
vp9-alpha webm (4.3s to 0.79s), for ~14% larger temp files.
This commit is contained in:
Miguel Ángel
2026-07-03 13:39:02 -07:00
committed by GitHub
parent 2dfae0c8b2
commit 557a270271
@@ -271,7 +271,8 @@ export async function extractVideoFramesRange(
args.push("-vf", vfFilters.join(","));
args.push("-q:v", format === "jpg" ? String(Math.ceil((100 - quality) / 3)) : "0");
if (format === "png") args.push("-compression_level", "6");
// Render-scoped temp frames are read once; level 1 measured 3-5x faster for ~14% larger files.
if (format === "png") args.push("-compression_level", "1");
args.push("-y", outputPattern);
return new Promise((resolve, reject) => {