@kvman/kvvideo 0.1.0 → 0.1.1
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/README.md +1 -1
- package/dist/api.d.ts +26 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/brand/brand.d.ts +17 -0
- package/dist/brand/brand.d.ts.map +1 -0
- package/dist/brand/brand.js +44 -0
- package/dist/brand/brand.js.map +1 -0
- package/dist/browser/launch.d.ts +2 -0
- package/dist/browser/launch.d.ts.map +1 -1
- package/dist/browser/launch.js +7 -1
- package/dist/browser/launch.js.map +1 -1
- package/dist/compose/ass-file.d.ts +5 -0
- package/dist/compose/ass-file.d.ts.map +1 -1
- package/dist/compose/ass-file.js +32 -3
- package/dist/compose/ass-file.js.map +1 -1
- package/dist/compose/background.d.ts +23 -0
- package/dist/compose/background.d.ts.map +1 -0
- package/dist/compose/background.js +31 -0
- package/dist/compose/background.js.map +1 -0
- package/dist/compose/camera.d.ts +32 -0
- package/dist/compose/camera.d.ts.map +1 -0
- package/dist/compose/camera.js +98 -0
- package/dist/compose/camera.js.map +1 -0
- package/dist/compose/caption-font.d.ts +2 -0
- package/dist/compose/caption-font.d.ts.map +1 -1
- package/dist/compose/caption-font.js +2 -1
- package/dist/compose/caption-font.js.map +1 -1
- package/dist/compose/compose-drawing.d.ts +19 -0
- package/dist/compose/compose-drawing.d.ts.map +1 -0
- package/dist/compose/compose-drawing.js +38 -0
- package/dist/compose/compose-drawing.js.map +1 -0
- package/dist/compose/compose-input.d.ts +139 -0
- package/dist/compose/compose-input.d.ts.map +1 -1
- package/dist/compose/compose-input.js +48 -9
- package/dist/compose/compose-input.js.map +1 -1
- package/dist/compose/compose-plan.d.ts +36 -0
- package/dist/compose/compose-plan.d.ts.map +1 -0
- package/dist/compose/compose-plan.js +55 -0
- package/dist/compose/compose-plan.js.map +1 -0
- package/dist/compose/compose-size.d.ts +50 -0
- package/dist/compose/compose-size.d.ts.map +1 -0
- package/dist/compose/compose-size.js +72 -0
- package/dist/compose/compose-size.js.map +1 -0
- package/dist/compose/drawn-images.d.ts +19 -0
- package/dist/compose/drawn-images.d.ts.map +1 -0
- package/dist/compose/drawn-images.js +75 -0
- package/dist/compose/drawn-images.js.map +1 -0
- package/dist/compose/final-pass.d.ts +34 -0
- package/dist/compose/final-pass.d.ts.map +1 -0
- package/dist/compose/final-pass.js +106 -0
- package/dist/compose/final-pass.js.map +1 -0
- package/dist/compose/frame-layout.d.ts +30 -0
- package/dist/compose/frame-layout.d.ts.map +1 -0
- package/dist/compose/frame-layout.js +33 -0
- package/dist/compose/frame-layout.js.map +1 -0
- package/dist/compose/overlays.d.ts +20 -0
- package/dist/compose/overlays.d.ts.map +1 -0
- package/dist/compose/overlays.js +30 -0
- package/dist/compose/overlays.js.map +1 -0
- package/dist/compose/page-again.d.ts +26 -0
- package/dist/compose/page-again.d.ts.map +1 -0
- package/dist/compose/page-again.js +50 -0
- package/dist/compose/page-again.js.map +1 -0
- package/dist/compose/player-copies.d.ts +5 -1
- package/dist/compose/player-copies.d.ts.map +1 -1
- package/dist/compose/player-copies.js +19 -16
- package/dist/compose/player-copies.js.map +1 -1
- package/dist/compose/register-compose.d.ts.map +1 -1
- package/dist/compose/register-compose.js +106 -20
- package/dist/compose/register-compose.js.map +1 -1
- package/dist/compose/render.d.ts +13 -4
- package/dist/compose/render.d.ts.map +1 -1
- package/dist/compose/render.js +48 -22
- package/dist/compose/render.js.map +1 -1
- package/dist/compose/scene-args.d.ts +32 -7
- package/dist/compose/scene-args.d.ts.map +1 -1
- package/dist/compose/scene-args.js +77 -16
- package/dist/compose/scene-args.js.map +1 -1
- package/dist/compose/scene-look.d.ts +31 -0
- package/dist/compose/scene-look.d.ts.map +1 -0
- package/dist/compose/scene-look.js +46 -0
- package/dist/compose/scene-look.js.map +1 -0
- package/dist/compose/scene-plan.d.ts +0 -2
- package/dist/compose/scene-plan.d.ts.map +1 -1
- package/dist/compose/scene-plan.js +7 -5
- package/dist/compose/scene-plan.js.map +1 -1
- package/dist/compose/sound-effects.d.ts +23 -0
- package/dist/compose/sound-effects.d.ts.map +1 -0
- package/dist/compose/sound-effects.js +40 -0
- package/dist/compose/sound-effects.js.map +1 -0
- package/dist/compose/srt.d.ts +3 -0
- package/dist/compose/srt.d.ts.map +1 -0
- package/dist/compose/srt.js +10 -0
- package/dist/compose/srt.js.map +1 -0
- package/dist/compose/transitions.d.ts +16 -0
- package/dist/compose/transitions.d.ts.map +1 -0
- package/dist/compose/transitions.js +38 -0
- package/dist/compose/transitions.js.map +1 -0
- package/dist/connector.d.ts +67 -14
- package/dist/connector.d.ts.map +1 -1
- package/dist/connector.js +27 -8
- package/dist/connector.js.map +1 -1
- package/dist/files/sidecar.d.ts +209 -0
- package/dist/files/sidecar.d.ts.map +1 -0
- package/dist/files/sidecar.js +66 -0
- package/dist/files/sidecar.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/narration/alignment.d.ts +15 -0
- package/dist/narration/alignment.d.ts.map +1 -0
- package/dist/narration/alignment.js +21 -0
- package/dist/narration/alignment.js.map +1 -0
- package/dist/narration/captions.d.ts +22 -4
- package/dist/narration/captions.d.ts.map +1 -1
- package/dist/narration/captions.js +44 -16
- package/dist/narration/captions.js.map +1 -1
- package/dist/narration/join-args.d.ts +3 -0
- package/dist/narration/join-args.d.ts.map +1 -0
- package/dist/narration/join-args.js +19 -0
- package/dist/narration/join-args.js.map +1 -0
- package/dist/narration/narration-cache.d.ts +25 -0
- package/dist/narration/narration-cache.d.ts.map +1 -0
- package/dist/narration/narration-cache.js +36 -0
- package/dist/narration/narration-cache.js.map +1 -0
- package/dist/narration/piper.d.ts +2 -6
- package/dist/narration/piper.d.ts.map +1 -1
- package/dist/narration/piper.js +9 -15
- package/dist/narration/piper.js.map +1 -1
- package/dist/narration/pronunciations.d.ts +11 -0
- package/dist/narration/pronunciations.d.ts.map +1 -0
- package/dist/narration/pronunciations.js +40 -0
- package/dist/narration/pronunciations.js.map +1 -0
- package/dist/narration/register-narration.d.ts +8 -0
- package/dist/narration/register-narration.d.ts.map +1 -1
- package/dist/narration/register-narration.js +54 -26
- package/dist/narration/register-narration.js.map +1 -1
- package/dist/narration/register-voice.d.ts +27 -0
- package/dist/narration/register-voice.d.ts.map +1 -0
- package/dist/narration/register-voice.js +82 -0
- package/dist/narration/register-voice.js.map +1 -0
- package/dist/narration/sentence-speaker.d.ts +35 -0
- package/dist/narration/sentence-speaker.d.ts.map +1 -0
- package/dist/narration/sentence-speaker.js +44 -0
- package/dist/narration/sentence-speaker.js.map +1 -0
- package/dist/narration/speech-services.d.ts +23 -3
- package/dist/narration/speech-services.d.ts.map +1 -1
- package/dist/narration/speech-services.js +27 -10
- package/dist/narration/speech-services.js.map +1 -1
- package/dist/narration/voice-args.d.ts +3 -0
- package/dist/narration/voice-args.d.ts.map +1 -0
- package/dist/narration/voice-args.js +10 -0
- package/dist/narration/voice-args.js.map +1 -0
- package/dist/programs/media-duration.d.ts +12 -0
- package/dist/programs/media-duration.d.ts.map +1 -1
- package/dist/programs/media-duration.js +13 -0
- package/dist/programs/media-duration.js.map +1 -1
- package/dist/programs/run-program.d.ts +1 -0
- package/dist/programs/run-program.d.ts.map +1 -1
- package/dist/programs/run-program.js +1 -0
- package/dist/programs/run-program.js.map +1 -1
- package/dist/record/address.d.ts +1 -1
- package/dist/record/address.d.ts.map +1 -1
- package/dist/record/address.js +5 -7
- package/dist/record/address.js.map +1 -1
- package/dist/record/cursor-script.d.ts +2 -1
- package/dist/record/cursor-script.d.ts.map +1 -1
- package/dist/record/cursor-script.js +52 -14
- package/dist/record/cursor-script.js.map +1 -1
- package/dist/record/encoder-args.js +1 -1
- package/dist/record/motion.d.ts +19 -0
- package/dist/record/motion.d.ts.map +1 -0
- package/dist/record/motion.js +59 -0
- package/dist/record/motion.js.map +1 -0
- package/dist/record/narration-cues.d.ts +14 -0
- package/dist/record/narration-cues.d.ts.map +1 -0
- package/dist/record/narration-cues.js +12 -0
- package/dist/record/narration-cues.js.map +1 -0
- package/dist/record/page-ready.d.ts +4 -0
- package/dist/record/page-ready.d.ts.map +1 -0
- package/dist/record/page-ready.js +15 -0
- package/dist/record/page-ready.js.map +1 -0
- package/dist/record/page-route.d.ts +13 -0
- package/dist/record/page-route.d.ts.map +1 -0
- package/dist/record/page-route.js +64 -0
- package/dist/record/page-route.js.map +1 -0
- package/dist/record/pointer.d.ts +6 -7
- package/dist/record/pointer.d.ts.map +1 -1
- package/dist/record/pointer.js +11 -10
- package/dist/record/pointer.js.map +1 -1
- package/dist/record/recorder.d.ts +17 -7
- package/dist/record/recorder.d.ts.map +1 -1
- package/dist/record/recorder.js +48 -18
- package/dist/record/recorder.js.map +1 -1
- package/dist/record/register-record.d.ts.map +1 -1
- package/dist/record/register-record.js +47 -13
- package/dist/record/register-record.js.map +1 -1
- package/dist/record/run-step.d.ts +16 -3
- package/dist/record/run-step.d.ts.map +1 -1
- package/dist/record/run-step.js +43 -23
- package/dist/record/run-step.js.map +1 -1
- package/dist/record/screencast.js +1 -1
- package/dist/record/steps.d.ts +54 -1
- package/dist/record/steps.d.ts.map +1 -1
- package/dist/record/steps.js +34 -16
- package/dist/record/steps.js.map +1 -1
- package/dist/review/analysis.d.ts +19 -0
- package/dist/review/analysis.d.ts.map +1 -0
- package/dist/review/analysis.js +36 -0
- package/dist/review/analysis.js.map +1 -0
- package/dist/review/frames.d.ts +9 -0
- package/dist/review/frames.d.ts.map +1 -0
- package/dist/review/frames.js +28 -0
- package/dist/review/frames.js.map +1 -0
- package/dist/review/register-review.d.ts +24 -0
- package/dist/review/register-review.d.ts.map +1 -0
- package/dist/review/register-review.js +81 -0
- package/dist/review/register-review.js.map +1 -0
- package/dist/review/sheet-args.d.ts +11 -0
- package/dist/review/sheet-args.d.ts.map +1 -0
- package/dist/review/sheet-args.js +24 -0
- package/dist/review/sheet-args.js.map +1 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +4 -2
- package/dist/settings.js.map +1 -1
- package/dist/setup/ffmpeg-readiness.js +1 -1
- package/dist/setup/ffmpeg-readiness.js.map +1 -1
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +3 -2
- package/dist/ui.js.map +1 -1
- package/dist/web/components/player.css +1 -1
- package/dist/web/components/player.js +33 -21
- package/docs/guide.md +21 -9
- package/locales/ar.json +12 -1
- package/locales/en.json +12 -1
- package/package.json +11 -5
- package/sounds/SOURCES.md +13 -0
- package/sounds/click.wav +0 -0
- package/sounds/keys.wav +0 -0
- package/sounds/pop.wav +0 -0
- package/sounds/whoosh.wav +0 -0
package/dist/record/steps.d.ts
CHANGED
|
@@ -2,70 +2,123 @@ import { z } from '@kvman/sdk';
|
|
|
2
2
|
export declare const stepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
3
|
do: z.ZodLiteral<"goto">;
|
|
4
4
|
url: z.ZodString;
|
|
5
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
5
6
|
}, z.core.$strict>, z.ZodObject<{
|
|
6
7
|
do: z.ZodLiteral<"click">;
|
|
7
8
|
target: z.ZodString;
|
|
9
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
8
10
|
}, z.core.$strict>, z.ZodObject<{
|
|
9
11
|
do: z.ZodLiteral<"type">;
|
|
10
12
|
target: z.ZodString;
|
|
11
13
|
text: z.ZodString;
|
|
14
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
12
15
|
}, z.core.$strict>, z.ZodObject<{
|
|
13
16
|
do: z.ZodLiteral<"press">;
|
|
14
17
|
key: z.ZodString;
|
|
18
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
15
19
|
}, z.core.$strict>, z.ZodObject<{
|
|
16
20
|
do: z.ZodLiteral<"hover">;
|
|
17
21
|
target: z.ZodString;
|
|
22
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
18
23
|
}, z.core.$strict>, z.ZodObject<{
|
|
19
24
|
do: z.ZodLiteral<"scroll">;
|
|
20
25
|
pixels: z.ZodNumber;
|
|
26
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
21
27
|
}, z.core.$strict>, z.ZodObject<{
|
|
22
28
|
do: z.ZodLiteral<"wait">;
|
|
23
29
|
ms: z.ZodNumber;
|
|
24
30
|
}, z.core.$strict>, z.ZodObject<{
|
|
25
31
|
do: z.ZodLiteral<"waitFor">;
|
|
26
32
|
target: z.ZodString;
|
|
33
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
27
34
|
}, z.core.$strict>], "do">;
|
|
28
35
|
/** One step of a recording. */
|
|
29
36
|
export type Step = z.output<typeof stepSchema>;
|
|
30
37
|
export declare const recordInputSchema: z.ZodObject<{
|
|
31
|
-
url: z.ZodString
|
|
38
|
+
url: z.ZodExactOptional<z.ZodString>;
|
|
39
|
+
page: z.ZodExactOptional<z.ZodString>;
|
|
32
40
|
steps: z.ZodExactOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
33
41
|
do: z.ZodLiteral<"goto">;
|
|
34
42
|
url: z.ZodString;
|
|
43
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
35
44
|
}, z.core.$strict>, z.ZodObject<{
|
|
36
45
|
do: z.ZodLiteral<"click">;
|
|
37
46
|
target: z.ZodString;
|
|
47
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
38
48
|
}, z.core.$strict>, z.ZodObject<{
|
|
39
49
|
do: z.ZodLiteral<"type">;
|
|
40
50
|
target: z.ZodString;
|
|
41
51
|
text: z.ZodString;
|
|
52
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
42
53
|
}, z.core.$strict>, z.ZodObject<{
|
|
43
54
|
do: z.ZodLiteral<"press">;
|
|
44
55
|
key: z.ZodString;
|
|
56
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
45
57
|
}, z.core.$strict>, z.ZodObject<{
|
|
46
58
|
do: z.ZodLiteral<"hover">;
|
|
47
59
|
target: z.ZodString;
|
|
60
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
48
61
|
}, z.core.$strict>, z.ZodObject<{
|
|
49
62
|
do: z.ZodLiteral<"scroll">;
|
|
50
63
|
pixels: z.ZodNumber;
|
|
64
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
51
65
|
}, z.core.$strict>, z.ZodObject<{
|
|
52
66
|
do: z.ZodLiteral<"wait">;
|
|
53
67
|
ms: z.ZodNumber;
|
|
54
68
|
}, z.core.$strict>, z.ZodObject<{
|
|
55
69
|
do: z.ZodLiteral<"waitFor">;
|
|
56
70
|
target: z.ZodString;
|
|
71
|
+
atLine: z.ZodExactOptional<z.ZodNumber>;
|
|
57
72
|
}, z.core.$strict>], "do">>>;
|
|
58
73
|
file: z.ZodString;
|
|
59
74
|
width: z.ZodExactOptional<z.ZodNumber>;
|
|
60
75
|
height: z.ZodExactOptional<z.ZodNumber>;
|
|
76
|
+
device: z.ZodExactOptional<z.ZodEnum<{
|
|
77
|
+
phone: "phone";
|
|
78
|
+
desktop: "desktop";
|
|
79
|
+
}>>;
|
|
80
|
+
narration: z.ZodExactOptional<z.ZodString>;
|
|
61
81
|
replace: z.ZodExactOptional<z.ZodBoolean>;
|
|
62
82
|
}, z.core.$strict>;
|
|
83
|
+
/** A recording's input. */
|
|
84
|
+
export type RecordInput = z.output<typeof recordInputSchema>;
|
|
85
|
+
declare const boxSchema: z.ZodObject<{
|
|
86
|
+
x: z.ZodNumber;
|
|
87
|
+
y: z.ZodNumber;
|
|
88
|
+
width: z.ZodNumber;
|
|
89
|
+
height: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
/** A target's box, in CSS pixels of the viewport. */
|
|
92
|
+
export type Box = z.output<typeof boxSchema>;
|
|
93
|
+
export declare const actionSchema: z.ZodObject<{
|
|
94
|
+
do: z.ZodString;
|
|
95
|
+
atMs: z.ZodNumber;
|
|
96
|
+
actMs: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
endMs: z.ZodNumber;
|
|
98
|
+
box: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
x: z.ZodNumber;
|
|
100
|
+
y: z.ZodNumber;
|
|
101
|
+
width: z.ZodNumber;
|
|
102
|
+
height: z.ZodNumber;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
/** What a step did, and when, from the recording's start. */
|
|
106
|
+
export type Action = z.output<typeof actionSchema>;
|
|
63
107
|
export declare const recordOutputSchema: z.ZodObject<{
|
|
64
108
|
file: z.ZodString;
|
|
65
109
|
durationMs: z.ZodNumber;
|
|
66
110
|
steps: z.ZodArray<z.ZodObject<{
|
|
67
111
|
do: z.ZodString;
|
|
68
112
|
atMs: z.ZodNumber;
|
|
113
|
+
actMs: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
endMs: z.ZodNumber;
|
|
115
|
+
box: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
x: z.ZodNumber;
|
|
117
|
+
y: z.ZodNumber;
|
|
118
|
+
width: z.ZodNumber;
|
|
119
|
+
height: z.ZodNumber;
|
|
120
|
+
}, z.core.$strip>>;
|
|
69
121
|
}, z.core.$strip>>;
|
|
70
122
|
}, z.core.$strip>;
|
|
123
|
+
export {};
|
|
71
124
|
//# sourceMappingURL=steps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../src/record/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../src/record/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAS/B,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BASrB,CAAC;AAEH,+BAA+B;AAC/B,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC;AAgB/C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAK5B,CAAC;AAEH,2BAA2B;AAC3B,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D,QAAA,MAAM,SAAS;;;;;iBAAwI,CAAC;AAExJ,qDAAqD;AACrD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7C,eAAO,MAAM,YAAY;;;;;;;;;;;iBAMvB,CAAC;AAEH,6DAA6D;AAC7D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AAEnD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;iBAA2G,CAAC"}
|
package/dist/record/steps.js
CHANGED
|
@@ -1,29 +1,47 @@
|
|
|
1
1
|
import { z } from '@kvman/sdk';
|
|
2
|
-
// A recording's input (plan 16 §16.5): the
|
|
2
|
+
// A recording's input and answer (plan 16 §16.5): a website or a page of the workspace, up to 200 steps, the size and
|
|
3
|
+
// device, the narration whose caption lines the steps may wait for, and the output.
|
|
3
4
|
const target = z.string().min(1).max(500).describe('A Playwright selector: CSS, text=Save, or role=button[name="Save"]; its first match is used once visible.');
|
|
4
5
|
const address = z.string().min(1).max(2000);
|
|
6
|
+
const atLine = z.number().int().min(1).max(1000).describe('Start no earlier than this caption line (from 1) of the narration is heard.').exactOptional();
|
|
5
7
|
export const stepSchema = z.discriminatedUnion('do', [
|
|
6
|
-
z.strictObject({ do: z.literal('goto'), url: address.describe('
|
|
7
|
-
z.strictObject({ do: z.literal('click'), target }),
|
|
8
|
-
z.strictObject({ do: z.literal('type'), target, text: z.string().min(1).max(2000).describe('The text typed,
|
|
9
|
-
z.strictObject({ do: z.literal('press'), key: z.string().min(1).max(100).describe('A key or combination, as Enter or Control+A.') }),
|
|
10
|
-
z.strictObject({ do: z.literal('hover'), target }),
|
|
11
|
-
z.strictObject({ do: z.literal('scroll'), pixels: z.number().int().min(-20_000).max(20_000).describe('Pixels to scroll down; negative scrolls up.') }),
|
|
8
|
+
z.strictObject({ do: z.literal('goto'), url: address.describe('An http or https address to open.'), atLine }),
|
|
9
|
+
z.strictObject({ do: z.literal('click'), target, atLine }),
|
|
10
|
+
z.strictObject({ do: z.literal('type'), target, text: z.string().min(1).max(2000).describe('The text typed, at a natural pace.'), atLine }),
|
|
11
|
+
z.strictObject({ do: z.literal('press'), key: z.string().min(1).max(100).describe('A key or combination, as Enter or Control+A.'), atLine }),
|
|
12
|
+
z.strictObject({ do: z.literal('hover'), target, atLine }),
|
|
13
|
+
z.strictObject({ do: z.literal('scroll'), pixels: z.number().int().min(-20_000).max(20_000).describe('Pixels to scroll down; negative scrolls up.'), atLine }),
|
|
12
14
|
z.strictObject({ do: z.literal('wait'), ms: z.number().int().min(0).max(60_000).describe('How long the picture holds.') }),
|
|
13
|
-
z.strictObject({ do: z.literal('waitFor'), target }),
|
|
15
|
+
z.strictObject({ do: z.literal('waitFor'), target, atLine }),
|
|
14
16
|
]);
|
|
15
17
|
const side = z.number().int().min(320).max(1920).refine((pixels) => pixels % 2 === 0, 'A side is an even number of pixels.');
|
|
16
|
-
|
|
17
|
-
url: address.describe('
|
|
18
|
+
const recordFields = z.strictObject({
|
|
19
|
+
url: address.describe('A website to record: any http or https address.').exactOptional(),
|
|
20
|
+
page: z.string().min(1).max(1000).describe('An .html file of the workspace to record, with the files beside it.').exactOptional(),
|
|
18
21
|
steps: z.array(stepSchema).max(200).describe('What happens on the page, in order.').exactOptional(),
|
|
19
22
|
file: z.string().min(1).max(1000).describe('The .mp4 file to write, in the workspace.'),
|
|
20
|
-
width: side.describe('The width in pixels
|
|
21
|
-
height: side.describe('The height in pixels
|
|
23
|
+
width: side.describe('The page width in CSS pixels: 1280 by default, 390 on a phone. The file is twice as wide.').exactOptional(),
|
|
24
|
+
height: side.describe('The page height in CSS pixels: 720 by default, 844 on a phone. The file is twice as high.').exactOptional(),
|
|
25
|
+
device: z.enum(['desktop', 'phone']).describe('desktop (the default), or phone: a touch screen with taps.').exactOptional(),
|
|
26
|
+
narration: z.string().min(1).max(1000).describe("The scene's narration (.mp3, .wav, .m4a), as narrate or voice made it; steps may wait for its lines with atLine.").exactOptional(),
|
|
22
27
|
replace: z.boolean().describe('Write over an existing file.').exactOptional(),
|
|
23
28
|
});
|
|
24
|
-
export const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
steps
|
|
29
|
+
export const recordInputSchema = recordFields.superRefine((input, context) => {
|
|
30
|
+
if ((input.url === undefined) === (input.page === undefined))
|
|
31
|
+
context.addIssue({ code: 'custom', path: ['url'], message: 'Give exactly one of url and page.' });
|
|
32
|
+
const steps = input.steps ?? [];
|
|
33
|
+
if (input.page !== undefined && steps.some((step) => step.do === 'goto'))
|
|
34
|
+
context.addIssue({ code: 'custom', path: ['steps'], message: 'A page has no goto steps.' });
|
|
35
|
+
if (input.narration === undefined && steps.some((step) => step.do !== 'wait' && step.atLine !== undefined))
|
|
36
|
+
context.addIssue({ code: 'custom', path: ['narration'], message: 'atLine needs a narration.' });
|
|
28
37
|
});
|
|
38
|
+
const boxSchema = z.object({ x: z.number().int(), y: z.number().int(), width: z.number().int().nonnegative(), height: z.number().int().nonnegative() });
|
|
39
|
+
export const actionSchema = z.object({
|
|
40
|
+
do: z.string(),
|
|
41
|
+
atMs: z.number().int().nonnegative(),
|
|
42
|
+
actMs: z.number().int().nonnegative().optional(),
|
|
43
|
+
endMs: z.number().int().nonnegative(),
|
|
44
|
+
box: boxSchema.optional(),
|
|
45
|
+
});
|
|
46
|
+
export const recordOutputSchema = z.object({ file: z.string(), durationMs: z.number().int().nonnegative(), steps: z.array(actionSchema) });
|
|
29
47
|
//# sourceMappingURL=steps.js.map
|
package/dist/record/steps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../src/record/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,
|
|
1
|
+
{"version":3,"file":"steps.js","sourceRoot":"","sources":["../../src/record/steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,sHAAsH;AACtH,oFAAoF;AAEpF,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,2GAA2G,CAAC,CAAC;AAChK,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,6EAA6E,CAAC,CAAC,aAAa,EAAE,CAAC;AAEzJ,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE;IACnD,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,mCAAmC,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7G,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1D,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,E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AAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAKxJ,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAChD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACrC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;CAC1B,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ProblemKind = 'silence' | 'black' | 'frozen' | 'loudness';
|
|
2
|
+
export type Problem = {
|
|
3
|
+
kind: ProblemKind;
|
|
4
|
+
atMs: number;
|
|
5
|
+
lengthMs: number;
|
|
6
|
+
};
|
|
7
|
+
export type Loudness = {
|
|
8
|
+
integratedLufs: number;
|
|
9
|
+
truePeakDb: number;
|
|
10
|
+
};
|
|
11
|
+
export type Analysis = {
|
|
12
|
+
loudness: Loudness | null;
|
|
13
|
+
problems: Problem[];
|
|
14
|
+
};
|
|
15
|
+
/** ffmpeg's arguments to analyse `video`, with its sound when it has one. */
|
|
16
|
+
export declare function analysisArgs(video: string, hasSound: boolean): string[];
|
|
17
|
+
/** The analysis in ffmpeg's output, over a video of `durationMs`. */
|
|
18
|
+
export declare function analysisOf(output: string, durationMs: number, hasSound: boolean): Analysis;
|
|
19
|
+
//# sourceMappingURL=analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../src/review/analysis.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtE,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E,MAAM,MAAM,QAAQ,GAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC;AAE1E,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,CAIvE;AAoBD,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAQ1F"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// What `review` measures in one ffmpeg run (plan 16 §16.10; ADR 0115, 20 and 48): black pictures of 0.5 s or more,
|
|
2
|
+
// pictures unchanged for 6 s or more, sound below −50 dB for 3 s or more, and the loudness, read from what ffmpeg's
|
|
3
|
+
// filters print. A video without sound is measured for its picture only.
|
|
4
|
+
/** ffmpeg's arguments to analyse `video`, with its sound when it has one. */
|
|
5
|
+
export function analysisArgs(video, hasSound) {
|
|
6
|
+
const picture = '[0:v]blackdetect=d=0.5:pix_th=0.10,freezedetect=n=-60dB:d=6[v]';
|
|
7
|
+
const sound = hasSound ? ';[0:a]silencedetect=n=-50dB:d=3,ebur128=peak=true[a]' : '';
|
|
8
|
+
return ['-hide_banner', '-nostats', '-loglevel', 'info', '-i', video, '-filter_complex', `${picture}${sound}`, '-map', '[v]', ...(hasSound ? ['-map', '[a]'] : []), '-f', 'null', '-'];
|
|
9
|
+
}
|
|
10
|
+
const ms = (seconds) => Math.round(Number(seconds ?? 0) * 1000);
|
|
11
|
+
// Spans that start on one line and end on a later one; one that never ends lasts to the video's end.
|
|
12
|
+
function spans(output, start, end, durationMs) {
|
|
13
|
+
const starts = [...output.matchAll(start)].map((match) => ms(match[1]));
|
|
14
|
+
const ends = [...output.matchAll(end)].map((match) => ms(match[1]));
|
|
15
|
+
return starts.map((atMs, index) => ({ atMs, lengthMs: Math.max(0, (ends[index] ?? durationMs) - atMs) }));
|
|
16
|
+
}
|
|
17
|
+
function loudnessOf(output) {
|
|
18
|
+
const summary = output.slice(output.lastIndexOf('Summary:'));
|
|
19
|
+
const integrated = /I:\s+(-?[\d.]+|-inf) LUFS/.exec(summary)?.[1];
|
|
20
|
+
const peak = /Peak:\s+(-?[\d.]+|-inf) dBFS/.exec(summary)?.[1];
|
|
21
|
+
if (integrated === undefined || peak === undefined)
|
|
22
|
+
return null;
|
|
23
|
+
// ebur128 floors its loudness at −70 LUFS; a peak of no sound at all, -inf, is read at that floor too.
|
|
24
|
+
return { integratedLufs: integrated === '-inf' ? -70 : Number(integrated), truePeakDb: peak === '-inf' ? -70 : Number(peak) };
|
|
25
|
+
}
|
|
26
|
+
/** The analysis in ffmpeg's output, over a video of `durationMs`. */
|
|
27
|
+
export function analysisOf(output, durationMs, hasSound) {
|
|
28
|
+
const black = [...output.matchAll(/black_start:([\d.]+) black_end:([\d.]+)/g)].map((match) => ({ kind: 'black', atMs: ms(match[1]), lengthMs: ms(match[2]) - ms(match[1]) }));
|
|
29
|
+
const frozen = spans(output, /freeze_start: ([\d.]+)/g, /freeze_end: ([\d.]+)/g, durationMs).map((span) => ({ kind: 'frozen', ...span }));
|
|
30
|
+
const silence = hasSound ? spans(output, /silence_start: (-?[\d.]+)/g, /silence_end: ([\d.]+)/g, durationMs).map((span) => ({ kind: 'silence', atMs: Math.max(0, span.atMs), lengthMs: span.lengthMs })) : [];
|
|
31
|
+
const loudness = hasSound ? loudnessOf(output) : null;
|
|
32
|
+
const off = loudness !== null && (loudness.integratedLufs < -15 || loudness.integratedLufs > -13 || loudness.truePeakDb > -1);
|
|
33
|
+
const problems = [...(off ? [{ kind: 'loudness', atMs: 0, lengthMs: durationMs }] : []), ...silence, ...black, ...frozen];
|
|
34
|
+
return { loudness, problems: problems.sort((a, b) => a.atMs - b.atMs) };
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/review/analysis.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,oHAAoH;AACpH,yEAAyE;AAUzE,6EAA6E;AAC7E,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,QAAiB;IAC3D,MAAM,OAAO,GAAG,gEAAgE,CAAC;IACjF,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,EAAE,CAAC;IACrF,OAAO,CAAC,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE,GAAG,OAAO,GAAG,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAA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,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACvN,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,MAAM,GAAG,GAAG,QAAQ,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,GAAG,CAAC,EAAE,IAAI,QAAQ,CAAC,cAAc,GAAG,CAAC,EAAE,IAAI,QAAQ,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9H,MAAM,QAAQ,GAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAmB,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC;IAC9I,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { z } from '@kvman/sdk';
|
|
2
|
+
import type { videoSidecarSchema } from '../files/sidecar.ts';
|
|
3
|
+
export type VideoSidecar = z.output<typeof videoSidecarSchema>;
|
|
4
|
+
export declare const perSheet = 12;
|
|
5
|
+
/** The frames' times in ms, in order. */
|
|
6
|
+
export declare function frameTimes(sidecar: VideoSidecar | undefined, durationMs: number): number[];
|
|
7
|
+
/** The frames in sheets of 12. */
|
|
8
|
+
export declare function sheetsOf(times: readonly number[]): number[][];
|
|
9
|
+
//# sourceMappingURL=frames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../src/review/frames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAM9D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI/D,eAAO,MAAM,QAAQ,KAAK,CAAC;AAU3B,yCAAyC;AACzC,wBAAgB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ1F;AAED,kCAAkC;AAClC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,CAE7D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const closest = 500;
|
|
2
|
+
const most = 96;
|
|
3
|
+
export const perSheet = 12;
|
|
4
|
+
function wanted(sidecar, durationMs) {
|
|
5
|
+
if (sidecar === undefined)
|
|
6
|
+
return Array.from({ length: Math.max(1, Math.ceil(durationMs / 5000)) }, (_, index) => index * 5000);
|
|
7
|
+
const middles = sidecar.scenes.map((scene) => Math.round((scene.startMs + scene.endMs) / 2));
|
|
8
|
+
const afterTransitions = sidecar.scenes.slice(1).map((scene) => scene.startMs + 400);
|
|
9
|
+
const captions = sidecar.captions.map((caption) => Math.round((caption.startMs + caption.endMs) / 2));
|
|
10
|
+
return [...middles, ...afterTransitions, ...captions];
|
|
11
|
+
}
|
|
12
|
+
/** The frames' times in ms, in order. */
|
|
13
|
+
export function frameTimes(sidecar, durationMs) {
|
|
14
|
+
const kept = [];
|
|
15
|
+
for (const time of wanted(sidecar, durationMs).filter((at) => at >= 0 && at < durationMs).sort((a, b) => a - b)) {
|
|
16
|
+
const last = kept.at(-1);
|
|
17
|
+
if (last === undefined || time - last >= closest)
|
|
18
|
+
kept.push(time);
|
|
19
|
+
}
|
|
20
|
+
if (kept.length <= most)
|
|
21
|
+
return kept;
|
|
22
|
+
return Array.from({ length: most }, (_, index) => kept[Math.round((index * (kept.length - 1)) / (most - 1))] ?? 0);
|
|
23
|
+
}
|
|
24
|
+
/** The frames in sheets of 12. */
|
|
25
|
+
export function sheetsOf(times) {
|
|
26
|
+
return Array.from({ length: Math.ceil(times.length / perSheet) }, (_, index) => times.slice(index * perSheet, (index + 1) * perSheet));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=frames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frames.js","sourceRoot":"","sources":["../../src/review/frames.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,IAAI,GAAG,EAAE,CAAC;AAChB,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAE3B,SAAS,MAAM,CAAC,OAAiC,EAAE,UAAkB;IACnE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAChI,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7F,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,GAA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H,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,QAAQ,CAAC,KAAwB;IAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AACzI,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z, type Ctx } from '@kvman/sdk';
|
|
2
|
+
export declare const reviewOutputSchema: z.ZodObject<{
|
|
3
|
+
durationMs: z.ZodNumber;
|
|
4
|
+
loudness: z.ZodNullable<z.ZodObject<{
|
|
5
|
+
integratedLufs: z.ZodNumber;
|
|
6
|
+
truePeakDb: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
problems: z.ZodArray<z.ZodObject<{
|
|
9
|
+
kind: z.ZodEnum<{
|
|
10
|
+
silence: "silence";
|
|
11
|
+
black: "black";
|
|
12
|
+
frozen: "frozen";
|
|
13
|
+
loudness: "loudness";
|
|
14
|
+
}>;
|
|
15
|
+
atMs: z.ZodNumber;
|
|
16
|
+
lengthMs: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
images: z.ZodArray<z.ZodObject<{
|
|
19
|
+
fileId: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare function registerReview(ctx: Ctx): void;
|
|
24
|
+
//# sourceMappingURL=register-review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-review.d.ts","sourceRoot":"","sources":["../../src/review/register-review.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAsBzC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;iBAK7B,CAAC;AAQH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CA4C7C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { copyFileSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { z } from '@kvman/sdk';
|
|
4
|
+
import { readSidecar } from "../files/sidecar.js";
|
|
5
|
+
import { inputPath } from "../files/workspace-paths.js";
|
|
6
|
+
import { workFolder } from "../files/place-output.js";
|
|
7
|
+
import { bundledFonts, fontsFolder } from "../fonts/bundled-fonts.js";
|
|
8
|
+
import { trimOldest } from "../narration/narration-cache.js";
|
|
9
|
+
import { hasSound, mediaDuration, mediaSize } from "../programs/media-duration.js";
|
|
10
|
+
import { programOf } from "../programs/programs.js";
|
|
11
|
+
import { lastLines, runProgram } from "../programs/run-program.js";
|
|
12
|
+
import { kvvideoProblem } from "../problems.js";
|
|
13
|
+
import { analysisArgs, analysisOf } from "./analysis.js";
|
|
14
|
+
import { frameTimes, sheetsOf } from "./frames.js";
|
|
15
|
+
import { sheetArgs, sheetGraph, tileOf } from "./sheet-args.js";
|
|
16
|
+
// `video review` (plan 16 §16.10; ADR 0115, 20 and 48): measures a video's silences, black and frozen pictures, and
|
|
17
|
+
// loudness, and makes contact sheets of its frames that the model sees through kvcoder (`images: true`). The newest 24
|
|
18
|
+
// sheets of the workspace are kept in the kernel's files.
|
|
19
|
+
const keptSheets = 24;
|
|
20
|
+
const problemSchema = z.object({ kind: z.enum(['silence', 'black', 'frozen', 'loudness']), atMs: z.number().int().nonnegative(), lengthMs: z.number().int().nonnegative() });
|
|
21
|
+
export const reviewOutputSchema = z.object({
|
|
22
|
+
durationMs: z.number().int().nonnegative(),
|
|
23
|
+
loudness: z.object({ integratedLufs: z.number(), truePeakDb: z.number() }).nullable(),
|
|
24
|
+
problems: z.array(problemSchema),
|
|
25
|
+
images: z.array(z.object({ fileId: z.string(), name: z.string() })),
|
|
26
|
+
});
|
|
27
|
+
const sheetRowSchema = z.object({ fileId: z.string(), createdAt: z.string() });
|
|
28
|
+
function failed(reason) {
|
|
29
|
+
return kvvideoProblem('RENDER_FAILED', `ffmpeg couldn't review the video: ${reason}`, { scene: null, reason });
|
|
30
|
+
}
|
|
31
|
+
export function registerReview(ctx) {
|
|
32
|
+
ctx.registerCommand('kvvideo.video.review', {
|
|
33
|
+
description: "Reviews an MP4 of the workspace: its silences, black and frozen pictures, and loudness, and contact sheets of its frames to look at before telling the person it's ready.",
|
|
34
|
+
input: z.strictObject({ file: z.string().min(1).max(1000).describe('The .mp4 file to review, in the workspace.') }),
|
|
35
|
+
output: reviewOutputSchema,
|
|
36
|
+
public: true,
|
|
37
|
+
retries: 0,
|
|
38
|
+
timeoutMs: 600_000,
|
|
39
|
+
handle: async ({ file }) => {
|
|
40
|
+
const video = inputPath(ctx.job.workspace.path, file, ['.mp4']);
|
|
41
|
+
const [ffmpeg, ffprobe] = [await programOf(ctx, 'ffmpeg'), await programOf(ctx, 'ffprobe')];
|
|
42
|
+
const signal = ctx.job.signal;
|
|
43
|
+
const duration = await mediaDuration(ffprobe, video, signal);
|
|
44
|
+
const size = await mediaSize(ffprobe, video, signal);
|
|
45
|
+
if (!duration.ok || !size.ok)
|
|
46
|
+
throw failed(duration.ok ? (size.ok ? '' : size.reason) : duration.reason);
|
|
47
|
+
const sound = await hasSound(ffprobe, video, signal);
|
|
48
|
+
const measured = await runProgram(ffmpeg, analysisArgs(video, sound), { signal });
|
|
49
|
+
if (measured.exitCode !== 0)
|
|
50
|
+
throw failed(lastLines(measured.output));
|
|
51
|
+
const analysis = analysisOf(measured.output, duration.ms, sound);
|
|
52
|
+
const sidecar = readSidecar(video);
|
|
53
|
+
const sheets = sheetsOf(frameTimes(sidecar?.kind === 'video' ? sidecar : undefined, duration.ms)).slice(0, 8);
|
|
54
|
+
const tile = tileOf(size.width, size.height);
|
|
55
|
+
const work = workFolder();
|
|
56
|
+
try {
|
|
57
|
+
copyFileSync(path.join(fontsFolder, bundledFonts.find((font) => font.name === 'Poppins')?.file ?? ''), path.join(work.folder, 'font.ttf'));
|
|
58
|
+
const images = [];
|
|
59
|
+
for (const [index, times] of sheets.entries()) {
|
|
60
|
+
ctx.job.progress({ key: 'kvvideo.progress.sheet', params: { n: index + 1, of: sheets.length } });
|
|
61
|
+
writeFileSync(path.join(work.folder, 'sheet.graph'), sheetGraph(times, tile));
|
|
62
|
+
const made = await runProgram(ffmpeg, sheetArgs(video, times, 'sheet.graph', 'sheet.jpg'), { cwd: work.folder, signal });
|
|
63
|
+
if (made.exitCode !== 0)
|
|
64
|
+
throw failed(lastLines(made.output));
|
|
65
|
+
const name = `review-${String(index + 1)}.jpg`;
|
|
66
|
+
const stored = await ctx.files.write(name, readFileSync(path.join(work.folder, 'sheet.jpg')), 'image/jpeg');
|
|
67
|
+
images.push({ fileId: stored.id, name });
|
|
68
|
+
}
|
|
69
|
+
const rows = ctx.store.collection('reviewSheets', sheetRowSchema);
|
|
70
|
+
for (const image of images)
|
|
71
|
+
await rows.insert({ fileId: image.fileId, createdAt: new Date().toISOString() });
|
|
72
|
+
await trimOldest(rows, ctx.files, keptSheets);
|
|
73
|
+
return { durationMs: duration.ms, loudness: analysis.loudness, problems: analysis.problems, images };
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
work.remove();
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=register-review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-review.js","sourceRoot":"","sources":["../../src/review/register-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,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export type Tile = {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
};
|
|
5
|
+
/** A frame's size on the sheet, for a video of `width` × `height`. */
|
|
6
|
+
export declare function tileOf(width: number, height: number): Tile;
|
|
7
|
+
/** A time as the sheet labels it, `m:ss.s`. */
|
|
8
|
+
export declare function timeLabel(ms: number): string;
|
|
9
|
+
export declare function sheetGraph(times: readonly number[], tile: Tile): string;
|
|
10
|
+
export declare function sheetArgs(video: string, times: readonly number[], graph: string, output: string): string[];
|
|
11
|
+
//# sourceMappingURL=sheet-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-args.d.ts","sourceRoot":"","sources":["../../src/review/sheet-args.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAIrD,sEAAsE;AACtE,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAE1D;AAED,+CAA+C;AAC/C,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAMvE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAE1G"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// ffmpeg's arguments for one contact sheet (plan 16 §16.10; ADR 0115, 48): each frame taken at its time, 480 px on its
|
|
2
|
+
// longer side, labelled with its time (`m:ss.s`) in the bundled font, laid out 3 frames wide, as a JPEG. ffmpeg runs in
|
|
3
|
+
// the work folder, where the font is `font.ttf`.
|
|
4
|
+
const even = (value) => Math.max(2, 2 * Math.round(value / 2));
|
|
5
|
+
/** A frame's size on the sheet, for a video of `width` × `height`. */
|
|
6
|
+
export function tileOf(width, height) {
|
|
7
|
+
return width >= height ? { width: 480, height: even((480 * height) / width) } : { width: even((480 * width) / height), height: 480 };
|
|
8
|
+
}
|
|
9
|
+
/** A time as the sheet labels it, `m:ss.s`. */
|
|
10
|
+
export function timeLabel(ms) {
|
|
11
|
+
const tenths = Math.floor(ms / 100);
|
|
12
|
+
return `${String(Math.floor(tenths / 600))}:${String(Math.floor(tenths / 10) % 60).padStart(2, '0')}.${String(tenths % 10)}`;
|
|
13
|
+
}
|
|
14
|
+
export function sheetGraph(times, tile) {
|
|
15
|
+
const tiles = times.map((at, index) => `[${String(index)}:v]scale=${String(tile.width)}:${String(tile.height)},drawtext=fontfile=font.ttf:text='${timeLabel(at).replace(':', '\\:')}':x=10:y=h-th-10:fontsize=24:fontcolor=white:box=1:boxcolor=black@0.6:boxborderw=6[t${String(index)}]`);
|
|
16
|
+
const labels = times.map((_, index) => `[t${String(index)}]`).join('');
|
|
17
|
+
const layout = times.map((_, index) => `${String((index % 3) * tile.width)}_${String(Math.floor(index / 3) * tile.height)}`).join('|');
|
|
18
|
+
const stack = times.length === 1 ? `${labels}null[sheet]` : `${labels}xstack=inputs=${String(times.length)}:layout=${layout}:fill=black[sheet]`;
|
|
19
|
+
return [...tiles, stack].join(';\n');
|
|
20
|
+
}
|
|
21
|
+
export function sheetArgs(video, times, graph, output) {
|
|
22
|
+
return ['-hide_banner', '-loglevel', 'error', ...times.flatMap((at) => ['-ss', (at / 1000).toFixed(3), '-i', video]), '-filter_complex_script', graph, '-map', '[sheet]', '-frames:v', '1', '-q:v', '4', '-y', output];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=sheet-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-args.js","sourceRoot":"","sources":["../../src/review/sheet-args.ts"],"names":[],"mappings":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,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACzN,CAAC"}
|
package/dist/settings.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export declare const settingSchemas: {
|
|
|
22
22
|
msedge: "msedge";
|
|
23
23
|
}>;
|
|
24
24
|
program: z.ZodString;
|
|
25
|
+
pronunciations: z.ZodArray<z.ZodObject<{
|
|
26
|
+
word: z.ZodString;
|
|
27
|
+
say: z.ZodString;
|
|
28
|
+
}, z.core.$strict>>;
|
|
25
29
|
};
|
|
26
30
|
/** The setting that names a program. */
|
|
27
31
|
export declare function programSetting(program: ProgramName): `kvvideo.programs.${ProgramName}`;
|
package/dist/settings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAKzC,eAAO,MAAM,iBAAiB,4CAA6C,CAAC;AAE5E,2BAA2B;AAC3B,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,eAAO,MAAM,cAAc,uCAAwC,CAAC;AAEpE,uCAAuC;AACvC,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,eAAO,MAAM,YAAY,yCAA0C,CAAC;AAEpE,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAKzC,eAAO,MAAM,iBAAiB,4CAA6C,CAAC;AAE5E,2BAA2B;AAC3B,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,eAAO,MAAM,cAAc,uCAAwC,CAAC;AAEpE,uCAAuC;AACvC,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,eAAO,MAAM,YAAY,yCAA0C,CAAC;AAEpE,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAO1B,CAAC;AAEF,wCAAwC;AACxC,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,oBAAoB,WAAW,EAAE,CAEtF;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAS/C"}
|
package/dist/settings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from '@kvman/sdk';
|
|
2
|
-
// kvvideo's settings (plan 16 §16.2
|
|
3
|
-
// programs as a name on the PATH or a full path.
|
|
2
|
+
// kvvideo's settings (plan 16 §16.2; ADR 0107, 5 and 20; ADR 0115, 15): no narration service until the person
|
|
3
|
+
// chooses one, the words the narration says differently, and the programs as a name on the PATH or a full path.
|
|
4
4
|
export const narrationServices = ['elevenlabs', 'openai', 'piper'];
|
|
5
5
|
export const browserChoices = ['auto', 'chrome', 'msedge'];
|
|
6
6
|
export const programNames = ['ffmpeg', 'ffprobe', 'piper'];
|
|
@@ -10,6 +10,7 @@ export const settingSchemas = {
|
|
|
10
10
|
model: z.string().min(1).max(100).nullable(),
|
|
11
11
|
browser: z.enum(browserChoices),
|
|
12
12
|
program: z.string().min(1).max(1000),
|
|
13
|
+
pronunciations: z.array(z.strictObject({ word: z.string().min(1).max(100), say: z.string().min(1).max(200) })).max(200),
|
|
13
14
|
};
|
|
14
15
|
/** The setting that names a program. */
|
|
15
16
|
export function programSetting(program) {
|
|
@@ -19,6 +20,7 @@ export function registerSettings(ctx) {
|
|
|
19
20
|
ctx.registerSetting('kvvideo.narration.service', { description: 'The text-to-speech service that narrates; null until the person chooses one.', schema: settingSchemas.service, default: null });
|
|
20
21
|
ctx.registerSetting('kvvideo.narration.voice', { description: "The narration voice: a voice id for ElevenLabs or OpenAI, or the path of a Piper voice's .onnx file; null is the service's default.", schema: settingSchemas.voice, default: null });
|
|
21
22
|
ctx.registerSetting('kvvideo.narration.model', { description: "The narration model of ElevenLabs or OpenAI; null is the service's default.", schema: settingSchemas.model, default: null });
|
|
23
|
+
ctx.registerSetting('kvvideo.narration.pronunciations', { description: 'How the narration says words: each word, as a whole word in any case, is said as its say; captions keep the word as written.', schema: settingSchemas.pronunciations, default: [] });
|
|
22
24
|
ctx.registerSetting('kvvideo.browser', { description: 'The installed browser that records pages: auto tries Chrome, then Edge.', schema: settingSchemas.browser, default: 'auto', scopes: ['global'] });
|
|
23
25
|
for (const program of programNames) {
|
|
24
26
|
ctx.registerSetting(programSetting(program), { description: `The ${program} program: a name on the PATH, or a full path.`, schema: settingSchemas.program, default: program, scopes: ['global'] });
|
package/dist/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,YAAY,CAAC;AAEzC,
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,YAAY,CAAC;AAEzC,8GAA8G;AAC9G,gHAAgH;AAEhH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAK5E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,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E,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACjM,GAAG,CAAC,eAAe,CAAC,yBAAyB,EAAE,EAAE,WAAW,EAAE,qIAAqI,EAAE,MAAM,EAAE,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACpP,GAAG,CAAC,eAAe,CAAC,yBAAyB,EAAE,EAAE,WAAW,EAAE,6EAA6E,EAAE,MAAM,EAAE,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5L,GAAG,CAAC,eAAe,CAAC,kCAAkC,EAAE,EAAE,WAAW,EAAE,8HAA8H,EAAE,MAAM,EAAE,cAAc,CAAC,cAAc,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7P,GAAG,CAAC,eAAe,CAAC,iBAAiB,EAAE,EAAE,WAAW,EAAE,yEAAyE,EAAE,MAAM,EAAE,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxM,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACnC,GAAG,CAAC,eAAe,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,OAAO,+CAA+C,EAAE,MAAM,EAAE,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrM,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const encoders = ['libx264', 'aac', 'libmp3lame'];
|
|
2
|
-
const filters = ['subtitles'];
|
|
2
|
+
const filters = ['subtitles', 'xfade', 'loudnorm', 'afftdn', 'gradients', 'perspective', 'alphamerge', 'drawtext', 'xstack'];
|
|
3
3
|
function succeeded(answer) {
|
|
4
4
|
return answer !== undefined && answer.exitCode === 0;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ffmpeg-readiness.js","sourceRoot":"","sources":["../../src/setup/ffmpeg-readiness.ts"],"names":[],"mappings":"AAaA,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,YAAY,CAAU,CAAC;AAC3D,MAAM,OAAO,GAAG,CAAC,WAAW,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ffmpeg-readiness.js","sourceRoot":"","sources":["../../src/setup/ffmpeg-readiness.ts"],"names":[],"mappings":"AAaA,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,YAAY,CAAU,CAAC;AAC3D,MAAM,OAAO,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AAEtI,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;AACtI,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9D,OAAO,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AC;QACxC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrD,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACpD,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC;AAC1G,CAAC"}
|
package/dist/ui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAqBzC,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAQzC"}
|