@hyperframes/producer 0.8.173 → 0.8.174
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/distributed.d.ts +3 -1
- package/dist/distributed.js +468 -106
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +55 -55
- package/dist/index.js +481 -123
- package/dist/services/distributed/assemble.d.ts +2 -0
- package/dist/services/distributed/mp4Stitch.d.ts +38 -0
- package/dist/services/distributed/plan.d.ts +3 -3
- package/dist/services/render/audioPadTrim.d.ts +15 -0
- package/package.json +7 -7
|
@@ -66,4 +66,6 @@ export declare function assemble(planDir: string, chunkPaths: readonly string[],
|
|
|
66
66
|
*/
|
|
67
67
|
cfr?: boolean;
|
|
68
68
|
}): Promise<AssembleResult>;
|
|
69
|
+
/** Chunks that carry their audio are stitched under one index, the same bytes as the S3 stitch. */
|
|
70
|
+
export declare function chunksAreStitchedMp4(planDir: string, cfr: boolean): boolean;
|
|
69
71
|
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
interface Box {
|
|
2
|
+
type: string;
|
|
3
|
+
start: number;
|
|
4
|
+
bodyStart: number;
|
|
5
|
+
end: number;
|
|
6
|
+
}
|
|
7
|
+
/** Reads bytes `[start, end)`; returns fewer past the end of the object. */
|
|
8
|
+
export type ReadRange = (start: number, end: number) => Promise<Buffer>;
|
|
9
|
+
export interface Mp4Layout {
|
|
10
|
+
ftyp: Buffer;
|
|
11
|
+
moov: Buffer;
|
|
12
|
+
/** File offsets of the mdat payload, `[payloadStart, payloadEnd)`. */
|
|
13
|
+
payloadStart: number;
|
|
14
|
+
payloadEnd: number;
|
|
15
|
+
}
|
|
16
|
+
/** Reads a chunk's ftyp and moov and locates its mdat payload without reading the payload. */
|
|
17
|
+
export declare function readMp4Layout(read: ReadRange): Promise<Mp4Layout>;
|
|
18
|
+
export interface TrackTable {
|
|
19
|
+
trak: Box;
|
|
20
|
+
handler: string;
|
|
21
|
+
timescale: number;
|
|
22
|
+
/** Media time the edit list starts presenting at (the AAC priming on audio). */
|
|
23
|
+
mediaTime: number;
|
|
24
|
+
stsd: Buffer;
|
|
25
|
+
durations: number[];
|
|
26
|
+
sizes: number[];
|
|
27
|
+
/** Per-sample keyframe flags; `null` when every sample is one (no stss). */
|
|
28
|
+
sync: boolean[] | null;
|
|
29
|
+
samplesPerChunk: number[];
|
|
30
|
+
chunkOffsets: number[];
|
|
31
|
+
}
|
|
32
|
+
/** Each track's sample tables, expanded to one entry per sample (and per chunk). */
|
|
33
|
+
export declare function readTracks(moov: Buffer): TrackTable[];
|
|
34
|
+
export declare function buildStitchedHeader(layouts: readonly Mp4Layout[]): Buffer;
|
|
35
|
+
/** Local join: the stitched header, then each chunk's mdat payload in order. Like the ffmpeg
|
|
36
|
+
* join, it writes in a work folder beside `outputPath` and renames only a finished file there. */
|
|
37
|
+
export declare function writeStitchedMp4(chunkPaths: readonly string[], outputPath: string): Promise<void>;
|
|
38
|
+
export {};
|
|
@@ -269,8 +269,8 @@ export declare class ChunkExceedsWorkerTimeoutError extends Error {
|
|
|
269
269
|
constructor(predictedChunkSeconds: number, workerTimeoutSeconds: number);
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
272
|
-
* The `maxParallelChunks` a plan uses: explicit
|
|
273
|
-
*
|
|
272
|
+
* The `maxParallelChunks` a plan uses: an explicit value, else one wave across `workerConcurrency`
|
|
273
|
+
* (16 if unknown), widened to fit `workerTimeoutSeconds` unless chunkSize/targetChunkFrames pin it.
|
|
274
274
|
*/
|
|
275
275
|
export declare function resolveMaxParallelChunks(config: Pick<DistributedRenderConfig, "maxParallelChunks" | "chunkSize" | "targetChunkFrames" | "workerTimeoutSeconds" | "workerConcurrency">, totalFrames: number,
|
|
276
276
|
/** Output pixels per frame, after supersampling. */
|
|
@@ -396,4 +396,4 @@ export declare function buildLocalExecutionPlan(projectDir: string, config: Dist
|
|
|
396
396
|
* @deprecated Use `planV2()` or `planV2WithPublisher()` for new integrations.
|
|
397
397
|
* This wrapper, its layout, and its result shape remain supported.
|
|
398
398
|
*/
|
|
399
|
-
export declare function plan(projectDir: string, config: DistributedRenderConfig, planDir: string): Promise<PlanResult>;
|
|
399
|
+
export declare function plan(projectDir: string, config: DistributedRenderConfig, planDir: string, options?: Pick<BuildLocalExecutionPlanOptions, "chunksCarryAudio">): Promise<PlanResult>;
|
|
@@ -111,5 +111,20 @@ export declare function buildPadTrimAudioArgs(audioPath: string, outputPath: str
|
|
|
111
111
|
* for the assembled video.
|
|
112
112
|
*/
|
|
113
113
|
export declare function padOrTrimAudioToVideoFrameCount(input: PadTrimAudioInput): Promise<PadTrimAudioResult>;
|
|
114
|
+
/**
|
|
115
|
+
* The true-peak half of {@link padOrTrimAudioToVideoFrameCount}, for AAC already encoded at its
|
|
116
|
+
* exact length: measures once and re-encodes only when the peak is over the ceiling.
|
|
117
|
+
*/
|
|
118
|
+
export declare function constrainAacTruePeak(input: {
|
|
119
|
+
audioPath: string;
|
|
120
|
+
targetDurationSeconds: number;
|
|
121
|
+
signal?: AbortSignal;
|
|
122
|
+
timeoutMs?: number;
|
|
123
|
+
}): Promise<{
|
|
124
|
+
success: boolean;
|
|
125
|
+
error?: string;
|
|
126
|
+
failureReason?: "external_interruption";
|
|
127
|
+
loweredDb?: number;
|
|
128
|
+
}>;
|
|
114
129
|
export declare function defaultProbeVideoFrameInfo(videoPath: string, signal?: AbortSignal): Promise<ProbeVideoFrameInfo>;
|
|
115
130
|
export declare function runFfprobeJson<T>(args: string[], signal?: AbortSignal): Promise<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/producer",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.174",
|
|
4
4
|
"description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"postcss": "^8.4.0",
|
|
36
36
|
"puppeteer": "^25.2.1",
|
|
37
37
|
"puppeteer-core": "^25.2.1",
|
|
38
|
-
"@hyperframes/
|
|
39
|
-
"@hyperframes/
|
|
40
|
-
"@hyperframes/parsers": "0.8.
|
|
41
|
-
"@hyperframes/lint": "0.8.
|
|
42
|
-
"@hyperframes/studio-server": "0.8.
|
|
38
|
+
"@hyperframes/core": "0.8.174",
|
|
39
|
+
"@hyperframes/engine": "0.8.174",
|
|
40
|
+
"@hyperframes/parsers": "0.8.174",
|
|
41
|
+
"@hyperframes/lint": "0.8.174",
|
|
42
|
+
"@hyperframes/studio-server": "0.8.174"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^25.0.10",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"tsx": "^4.21.0",
|
|
49
49
|
"typescript": "^5.7.2",
|
|
50
50
|
"vitest": "^4.1.11",
|
|
51
|
-
"@hyperframes/aws-lambda": "0.8.
|
|
51
|
+
"@hyperframes/aws-lambda": "0.8.174"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22"
|