mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
fix(engine): encode with the same x264 and x265 thread count on any host size (#6127)
* fix(engine): encode with the same x264 and x265 thread count on any host size libx264 and libx265 pick their thread count from the host core count when ffmpeg is not told one, and the bitstream depends on it, so the same frames encoded to different bytes on 8, 16 and 32 vCPU nodes and chunks of one render could differ. Both encoders now pass the thread count from the CPU quota (Node reads the container limit), which is fixed per pod. * chore(engine): raise the packed size budget for the encoder thread module
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { availableParallelism } from "node:os";
|
||||
|
||||
/** x264/x265 bitstreams depend on the thread count, so it comes from the CPU quota, never ffmpeg's host-core guess. */
|
||||
export function appendSoftwareEncoderThreadsArg(
|
||||
args: string[],
|
||||
parallelism: number = availableParallelism(),
|
||||
): void {
|
||||
args.push("-threads", String(Math.max(1, Math.floor(parallelism))));
|
||||
}
|
||||
Reference in New Issue
Block a user