mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 14:50:02 +00:00
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:
@@ -271,7 +271,8 @@ export async function extractVideoFramesRange(
|
|||||||
args.push("-vf", vfFilters.join(","));
|
args.push("-vf", vfFilters.join(","));
|
||||||
|
|
||||||
args.push("-q:v", format === "jpg" ? String(Math.ceil((100 - quality) / 3)) : "0");
|
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);
|
args.push("-y", outputPattern);
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user