pup-recorder 0.3.7 → 0.3.8
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/_tsup-dts-rollup.d.ts +91 -5
- package/dist/app.cjs +292 -9
- package/dist/index.js +2 -2
- package/package.json +11 -1
|
@@ -27,6 +27,8 @@ import z from 'zod';
|
|
|
27
27
|
/** Insert emulation prevention bytes (00 00 03) for Annex B compliance. */
|
|
28
28
|
export declare function addEmulationPrevention(nal: Buffer): Buffer;
|
|
29
29
|
|
|
30
|
+
export declare function advanceVideos(frame: WebFrameMain | undefined, timestampMs: number): Promise<void>;
|
|
31
|
+
|
|
30
32
|
export declare function advanceVirtualTime(cdp: Debugger, budget: number): Promise<void>;
|
|
31
33
|
|
|
32
34
|
export declare const ANNEX_B_START_CODE: Buffer<ArrayBuffer>;
|
|
@@ -182,6 +184,31 @@ export declare function createStegoURL(src: string, size: Size): string;
|
|
|
182
184
|
|
|
183
185
|
export declare function debounce<T extends (...args: unknown[]) => void>(fn: T, delay?: number): T;
|
|
184
186
|
|
|
187
|
+
export declare class DecodeSession {
|
|
188
|
+
readonly meta: VideoMeta;
|
|
189
|
+
private readonly src;
|
|
190
|
+
private readonly frameCount;
|
|
191
|
+
private ffmpeg;
|
|
192
|
+
private parser;
|
|
193
|
+
private ring;
|
|
194
|
+
private runBaseIdx;
|
|
195
|
+
private nextFrameIdx;
|
|
196
|
+
private waiters;
|
|
197
|
+
private exhausted;
|
|
198
|
+
constructor(meta: VideoMeta, src: string, frameCount: number);
|
|
199
|
+
getFrame(idxRaw: number): Promise<Buffer>;
|
|
200
|
+
close(): void;
|
|
201
|
+
private needsReseek;
|
|
202
|
+
private reseek;
|
|
203
|
+
private waitFrame;
|
|
204
|
+
private onServe;
|
|
205
|
+
private refillIfNeeded;
|
|
206
|
+
private spawn;
|
|
207
|
+
private onStdout;
|
|
208
|
+
private killFfmpeg;
|
|
209
|
+
private rejectAllWaiters;
|
|
210
|
+
}
|
|
211
|
+
|
|
185
212
|
export declare function decodeStego(bitmap: Buffer, size: Size): number | undefined;
|
|
186
213
|
|
|
187
214
|
declare const DEFAULT_DURATION = 5;
|
|
@@ -217,6 +244,27 @@ export declare interface DoneMsg {
|
|
|
217
244
|
|
|
218
245
|
export declare function drainPackets(ctx: CodecContext, pkt: Packet, stream: Stream, muxer: FormatMuxer): Promise<void>;
|
|
219
246
|
|
|
247
|
+
export declare class DualLayerMux {
|
|
248
|
+
private _s;
|
|
249
|
+
private _baseQueue;
|
|
250
|
+
private _alphaQueue;
|
|
251
|
+
constructor(s: DualLayerMuxOptions);
|
|
252
|
+
drain(muxer: FormatMuxer): Promise<void>;
|
|
253
|
+
desyncAfterEof(): string | undefined;
|
|
254
|
+
private receiveAll;
|
|
255
|
+
private snapshot;
|
|
256
|
+
private writePair;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export declare interface DualLayerMuxOptions {
|
|
260
|
+
baseCtx: CodecContext;
|
|
261
|
+
alphaCtx: CodecContext;
|
|
262
|
+
basePkt: Packet;
|
|
263
|
+
alphaPkt: Packet;
|
|
264
|
+
stream: Stream;
|
|
265
|
+
hevcCfg: NvencHevcConfig;
|
|
266
|
+
}
|
|
267
|
+
|
|
220
268
|
export declare function electronOpts(disableGpu: boolean): Promise<string[]>;
|
|
221
269
|
|
|
222
270
|
export declare function encodeNalHeader(type: number, layerId: number, temporalId: number): [number, number];
|
|
@@ -322,6 +370,17 @@ export declare class FrameDropStats {
|
|
|
322
370
|
finalize(): FrameDropScore;
|
|
323
371
|
}
|
|
324
372
|
|
|
373
|
+
export declare class FrameServer {
|
|
374
|
+
private sessions;
|
|
375
|
+
open(opts: OpenOptions): Promise<VideoMeta>;
|
|
376
|
+
getFrame(id: string, idx: number): Promise<Buffer>;
|
|
377
|
+
close(id: string): void;
|
|
378
|
+
closeAll(): void;
|
|
379
|
+
private must;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export declare const frameServer: FrameServer;
|
|
383
|
+
|
|
325
384
|
export declare type HwEncoder = VideoToolboxEncoder | NvencDualLayerEncoder;
|
|
326
385
|
|
|
327
386
|
export declare interface HwVideoEncoderOptions {
|
|
@@ -482,13 +541,14 @@ export { noerr as noerr_alias_1 }
|
|
|
482
541
|
|
|
483
542
|
export declare class NvencDualLayerEncoder implements Disposable {
|
|
484
543
|
private _s;
|
|
544
|
+
private _mux;
|
|
485
545
|
private _pts;
|
|
486
546
|
private constructor();
|
|
487
547
|
static create(opts: HwVideoEncoderOptions): Promise<NvencDualLayerEncoder>;
|
|
488
548
|
encode(bgraFrame: Frame, muxer: FormatMuxer): Promise<void>;
|
|
489
549
|
flush(muxer: FormatMuxer): Promise<void>;
|
|
490
550
|
[Symbol.dispose](): void;
|
|
491
|
-
private
|
|
551
|
+
private sendEof;
|
|
492
552
|
}
|
|
493
553
|
|
|
494
554
|
export declare interface NvencHevcConfig {
|
|
@@ -502,6 +562,11 @@ export declare interface NvencHevcConfig {
|
|
|
502
562
|
ppsHasLoopFilterAcrossSlicesFlag: boolean;
|
|
503
563
|
}
|
|
504
564
|
|
|
565
|
+
export declare interface OpenOptions {
|
|
566
|
+
src: string;
|
|
567
|
+
fps: number;
|
|
568
|
+
}
|
|
569
|
+
|
|
505
570
|
export declare function openVideoCtx(opts: VideoCtxOptions, label: string): Promise<CodecContext>;
|
|
506
571
|
|
|
507
572
|
export declare class OutputSink implements AsyncDisposable {
|
|
@@ -553,6 +618,19 @@ declare function periodical(callback: (count: number) => Promise<void> | void, m
|
|
|
553
618
|
export { periodical }
|
|
554
619
|
export { periodical as periodical_alias_1 }
|
|
555
620
|
|
|
621
|
+
export declare class PngStreamParser {
|
|
622
|
+
private buf;
|
|
623
|
+
feed(chunk: Buffer): Buffer[];
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export declare function probe(src: string): Promise<ProbeResult>;
|
|
627
|
+
|
|
628
|
+
export declare interface ProbeResult {
|
|
629
|
+
width: number;
|
|
630
|
+
height: number;
|
|
631
|
+
duration: number;
|
|
632
|
+
}
|
|
633
|
+
|
|
556
634
|
declare interface ProcessHandle {
|
|
557
635
|
process: ChildProcess;
|
|
558
636
|
wait: Promise<void>;
|
|
@@ -644,10 +722,6 @@ declare const RenderSchema: z.ZodObject<{
|
|
|
644
722
|
export { RenderSchema }
|
|
645
723
|
export { RenderSchema as RenderSchema_alias_1 }
|
|
646
724
|
|
|
647
|
-
export declare class RerenderError extends Error {
|
|
648
|
-
constructor(message: string);
|
|
649
|
-
}
|
|
650
|
-
|
|
651
725
|
export declare function resizeDrawable(cdp: Debugger, size: Size): Promise<void>;
|
|
652
726
|
|
|
653
727
|
declare interface RetryOptions<Args extends any[], Ret> {
|
|
@@ -688,6 +762,8 @@ export declare function send(cdp: Debugger, method: string, params?: object): Pr
|
|
|
688
762
|
|
|
689
763
|
export declare function setInterceptor({ source, window, useInnerProxy }: NetworkOptions): void;
|
|
690
764
|
|
|
765
|
+
export declare function setupFrameProtocol(): void;
|
|
766
|
+
|
|
691
767
|
export declare function setupPupProtocol(): void;
|
|
692
768
|
|
|
693
769
|
export declare function shoot(options: IPCRenderOptions): Promise<IpcDonePayload>;
|
|
@@ -741,6 +817,8 @@ declare function useRetry<Args extends any[], Ret>({ fn, maxAttempts, timeout, s
|
|
|
741
817
|
export { useRetry }
|
|
742
818
|
export { useRetry as useRetry_alias_1 }
|
|
743
819
|
|
|
820
|
+
export declare const VIDEO_SYMBOL = "__pup_video__";
|
|
821
|
+
|
|
744
822
|
export declare interface VideoCtxOptions {
|
|
745
823
|
codec: Codec;
|
|
746
824
|
width: number;
|
|
@@ -780,6 +858,14 @@ export declare interface VideoEncoderOptions {
|
|
|
780
858
|
muxer: FormatMuxer;
|
|
781
859
|
}
|
|
782
860
|
|
|
861
|
+
export declare interface VideoMeta {
|
|
862
|
+
id: string;
|
|
863
|
+
width: number;
|
|
864
|
+
height: number;
|
|
865
|
+
fps: number;
|
|
866
|
+
duration: number;
|
|
867
|
+
}
|
|
868
|
+
|
|
783
869
|
export declare interface VideoSetup {
|
|
784
870
|
video?: VideoEncoder_2;
|
|
785
871
|
hwVideo?: HwEncoder;
|