@norskvideo/norsk-studio-alpha 1.27.0-2025-07-09-0fcad3ea
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 +10 -0
- package/client/info.js +43461 -0
- package/client/processor.audioLevel/styles.css +165 -0
- package/client/shared/style.css +1627 -0
- package/client/shared/tailwind.css +31 -0
- package/client/style.css +1074 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -0
- package/lib/info.d.ts +3 -0
- package/lib/info.js +44 -0
- package/lib/info.js.map +1 -0
- package/lib/input.decklink/info.d.ts +3 -0
- package/lib/input.decklink/info.js +51 -0
- package/lib/input.decklink/info.js.map +1 -0
- package/lib/input.decklink/runtime.d.ts +12 -0
- package/lib/input.decklink/runtime.js +22 -0
- package/lib/input.decklink/runtime.js.map +1 -0
- package/lib/input.decklink/types.d.ts +23 -0
- package/lib/input.decklink/types.js +3 -0
- package/lib/input.decklink/types.js.map +1 -0
- package/lib/input.decklink/types.yaml +32 -0
- package/lib/input.mp4file/info.d.ts +3 -0
- package/lib/input.mp4file/info.js +34 -0
- package/lib/input.mp4file/info.js.map +1 -0
- package/lib/input.mp4file/runtime.d.ts +14 -0
- package/lib/input.mp4file/runtime.js +33 -0
- package/lib/input.mp4file/runtime.js.map +1 -0
- package/lib/input.mp4file/types.d.ts +23 -0
- package/lib/input.mp4file/types.js +3 -0
- package/lib/input.mp4file/types.js.map +1 -0
- package/lib/input.mp4file/types.yaml +30 -0
- package/lib/input.ndi/info.d.ts +3 -0
- package/lib/input.ndi/info.js +52 -0
- package/lib/input.ndi/info.js.map +1 -0
- package/lib/input.ndi/runtime.d.ts +24 -0
- package/lib/input.ndi/runtime.js +60 -0
- package/lib/input.ndi/runtime.js.map +1 -0
- package/lib/input.ndi/source-selection.d.ts +10 -0
- package/lib/input.ndi/source-selection.js +84 -0
- package/lib/input.ndi/source-selection.js.map +1 -0
- package/lib/input.ndi/types.d.ts +52 -0
- package/lib/input.ndi/types.js +3 -0
- package/lib/input.ndi/types.js.map +1 -0
- package/lib/input.ndi/types.yaml +37 -0
- package/lib/output.ndi/info.d.ts +8 -0
- package/lib/output.ndi/info.js +61 -0
- package/lib/output.ndi/info.js.map +1 -0
- package/lib/output.ndi/inline-view.d.ts +6 -0
- package/lib/output.ndi/inline-view.js +12 -0
- package/lib/output.ndi/inline-view.js.map +1 -0
- package/lib/output.ndi/runtime.d.ts +14 -0
- package/lib/output.ndi/runtime.js +35 -0
- package/lib/output.ndi/runtime.js.map +1 -0
- package/lib/output.ndi/types.d.ts +35 -0
- package/lib/output.ndi/types.js +3 -0
- package/lib/output.ndi/types.js.map +1 -0
- package/lib/output.ndi/types.yaml +72 -0
- package/lib/output.recorder/info.d.ts +10 -0
- package/lib/output.recorder/info.js +79 -0
- package/lib/output.recorder/info.js.map +1 -0
- package/lib/output.recorder/runtime.d.ts +66 -0
- package/lib/output.recorder/runtime.js +301 -0
- package/lib/output.recorder/runtime.js.map +1 -0
- package/lib/output.recorder/types.d.ts +225 -0
- package/lib/output.recorder/types.js +3 -0
- package/lib/output.recorder/types.js.map +1 -0
- package/lib/output.recorder/types.yaml +211 -0
- package/lib/processor.actionReplay/info.d.ts +25 -0
- package/lib/processor.actionReplay/info.js +77 -0
- package/lib/processor.actionReplay/info.js.map +1 -0
- package/lib/processor.actionReplay/runtime.d.ts +38 -0
- package/lib/processor.actionReplay/runtime.js +225 -0
- package/lib/processor.actionReplay/runtime.js.map +1 -0
- package/lib/processor.actionReplay/summary.d.ts +4 -0
- package/lib/processor.actionReplay/summary.js +76 -0
- package/lib/processor.actionReplay/summary.js.map +1 -0
- package/lib/processor.actionReplay/types.d.ts +38 -0
- package/lib/processor.actionReplay/types.js +3 -0
- package/lib/processor.actionReplay/types.js.map +1 -0
- package/lib/processor.actionReplay/types.yaml +74 -0
- package/lib/processor.audioLevel/info.d.ts +27 -0
- package/lib/processor.audioLevel/info.js +61 -0
- package/lib/processor.audioLevel/info.js.map +1 -0
- package/lib/processor.audioLevel/inline-view.d.ts +4 -0
- package/lib/processor.audioLevel/inline-view.js +26 -0
- package/lib/processor.audioLevel/inline-view.js.map +1 -0
- package/lib/processor.audioLevel/runtime.d.ts +26 -0
- package/lib/processor.audioLevel/runtime.js +86 -0
- package/lib/processor.audioLevel/runtime.js.map +1 -0
- package/lib/processor.audioLevel/summary-view.d.ts +7 -0
- package/lib/processor.audioLevel/summary-view.js +37 -0
- package/lib/processor.audioLevel/summary-view.js.map +1 -0
- package/lib/processor.audioLevel/types.d.ts +42 -0
- package/lib/processor.audioLevel/types.js +3 -0
- package/lib/processor.audioLevel/types.js.map +1 -0
- package/lib/processor.audioLevel/types.yaml +83 -0
- package/lib/processor.gemini-poc/info.d.ts +8 -0
- package/lib/processor.gemini-poc/info.js +59 -0
- package/lib/processor.gemini-poc/info.js.map +1 -0
- package/lib/processor.gemini-poc/runtime.d.ts +38 -0
- package/lib/processor.gemini-poc/runtime.js +132 -0
- package/lib/processor.gemini-poc/runtime.js.map +1 -0
- package/lib/processor.gemini-poc/types.d.ts +23 -0
- package/lib/processor.gemini-poc/types.js +3 -0
- package/lib/processor.gemini-poc/types.js.map +1 -0
- package/lib/processor.gemini-poc/types.yaml +43 -0
- package/lib/processor.mixMinus/info.d.ts +7 -0
- package/lib/processor.mixMinus/info.js +40 -0
- package/lib/processor.mixMinus/info.js.map +1 -0
- package/lib/processor.mixMinus/runtime.d.ts +23 -0
- package/lib/processor.mixMinus/runtime.js +85 -0
- package/lib/processor.mixMinus/runtime.js.map +1 -0
- package/lib/processor.mixMinus/types.d.ts +18 -0
- package/lib/processor.mixMinus/types.js +3 -0
- package/lib/processor.mixMinus/types.js.map +1 -0
- package/lib/processor.mixMinus/types.yaml +19 -0
- package/lib/processor.monetise/info.d.ts +3 -0
- package/lib/processor.monetise/info.js +72 -0
- package/lib/processor.monetise/info.js.map +1 -0
- package/lib/processor.monetise/runtime.d.ts +62 -0
- package/lib/processor.monetise/runtime.js +217 -0
- package/lib/processor.monetise/runtime.js.map +1 -0
- package/lib/processor.monetise/summary.d.ts +7 -0
- package/lib/processor.monetise/summary.js +40 -0
- package/lib/processor.monetise/summary.js.map +1 -0
- package/lib/processor.monetise/types.d.ts +16 -0
- package/lib/processor.monetise/types.js +3 -0
- package/lib/processor.monetise/types.js.map +1 -0
- package/lib/processor.monetise/types.yaml +9 -0
- package/lib/processor.whisper-transcribe/info.d.ts +9 -0
- package/lib/processor.whisper-transcribe/info.js +46 -0
- package/lib/processor.whisper-transcribe/info.js.map +1 -0
- package/lib/processor.whisper-transcribe/runtime.d.ts +22 -0
- package/lib/processor.whisper-transcribe/runtime.js +70 -0
- package/lib/processor.whisper-transcribe/runtime.js.map +1 -0
- package/lib/processor.whisper-transcribe/types.d.ts +21 -0
- package/lib/processor.whisper-transcribe/types.js +3 -0
- package/lib/processor.whisper-transcribe/types.js.map +1 -0
- package/lib/processor.whisper-transcribe/types.yaml +28 -0
- package/lib/shared/schemas.d.ts +8 -0
- package/lib/shared/schemas.js +44 -0
- package/lib/shared/schemas.js.map +1 -0
- package/lib/test/output.recorder.d.ts +1 -0
- package/lib/test/output.recorder.js +186 -0
- package/lib/test/output.recorder.js.map +1 -0
- package/lib/util.timestamps/info.d.ts +14 -0
- package/lib/util.timestamps/info.js +64 -0
- package/lib/util.timestamps/info.js.map +1 -0
- package/lib/util.timestamps/inline-view.d.ts +6 -0
- package/lib/util.timestamps/inline-view.js +95 -0
- package/lib/util.timestamps/inline-view.js.map +1 -0
- package/lib/util.timestamps/runtime.d.ts +13 -0
- package/lib/util.timestamps/runtime.js +51 -0
- package/lib/util.timestamps/runtime.js.map +1 -0
- package/lib/util.timestamps/types.d.ts +36 -0
- package/lib/util.timestamps/types.js +3 -0
- package/lib/util.timestamps/types.js.map +1 -0
- package/lib/util.timestamps/types.yaml +74 -0
- package/package.json +57 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
import { FunctionCallMetadata, GeminiProcessorNode, GeminiServerContent, Norsk } from '@norskvideo/norsk-sdk';
|
2
|
+
import { CreatedMediaNode, OnCreated, RelatedMediaNodes, ServerComponentDefinition, ServerComponentSchemas, StudioComponentInputStream, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { components } from './types';
|
4
|
+
export type GeminiAIConfig = components['schemas']['GeminiAIConfig'];
|
5
|
+
export type GeminiAIState = components['schemas']['GeminiAIState'];
|
6
|
+
export type GeminiAICommand = components['schemas']['GeminiAICommands'];
|
7
|
+
export type GeminiAIEvent = components['schemas']['GeminiAIEvents'];
|
8
|
+
export default class GeminiAIDefinition implements ServerComponentDefinition<GeminiAIConfig, GeminiAINode, GeminiAIState, GeminiAICommand, GeminiAIEvent> {
|
9
|
+
schemas(): Promise<ServerComponentSchemas>;
|
10
|
+
create(norsk: Norsk, cfg: GeminiAIConfig, cb: OnCreated<GeminiAINode>, runtime: StudioRuntime<GeminiAIState, GeminiAICommand, GeminiAIEvent>): Promise<void>;
|
11
|
+
}
|
12
|
+
declare class GeminiAINode implements CreatedMediaNode {
|
13
|
+
norsk: Norsk;
|
14
|
+
cfg: GeminiAIConfig;
|
15
|
+
initialised: Promise<void>;
|
16
|
+
logger: GeminiLogger;
|
17
|
+
gemini?: GeminiProcessorNode;
|
18
|
+
runtime: StudioRuntime<GeminiAIState, GeminiAICommand, GeminiAIEvent>;
|
19
|
+
t0: Date;
|
20
|
+
constructor(norsk: Norsk, cfg: GeminiAIConfig, runtime: StudioRuntime<GeminiAIState, GeminiAICommand, GeminiAIEvent>);
|
21
|
+
get id(): string;
|
22
|
+
relatedMediaNodes: RelatedMediaNodes;
|
23
|
+
textDetected(_callMetadata: FunctionCallMetadata, text: string): Promise<void>;
|
24
|
+
jsonDetected(_callMetadata: FunctionCallMetadata, jsonString: string): Promise<void>;
|
25
|
+
initialise(): Promise<void>;
|
26
|
+
subscribe(sources: StudioComponentInputStream[]): Promise<void>;
|
27
|
+
}
|
28
|
+
export declare class GeminiLogger {
|
29
|
+
id: string;
|
30
|
+
t0: Date;
|
31
|
+
inTurn: boolean;
|
32
|
+
currentStr: string;
|
33
|
+
runtime: StudioRuntime<GeminiAIState, GeminiAICommand, GeminiAIEvent>;
|
34
|
+
constructor(id: string, runtime: StudioRuntime<GeminiAIState, GeminiAICommand, GeminiAIEvent>);
|
35
|
+
logContent(content: GeminiServerContent): void;
|
36
|
+
}
|
37
|
+
export declare function exhaustiveCheck(a: never): never;
|
38
|
+
export {};
|
@@ -0,0 +1,132 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.GeminiLogger = void 0;
|
7
|
+
exports.exhaustiveCheck = exhaustiveCheck;
|
8
|
+
const runtime_types_1 = require("@norskvideo/norsk-studio/lib/extension/runtime-types");
|
9
|
+
const process_1 = require("process");
|
10
|
+
const path_1 = __importDefault(require("path"));
|
11
|
+
const schemas_1 = require("../shared/schemas");
|
12
|
+
const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
|
13
|
+
class GeminiAIDefinition {
|
14
|
+
async schemas() {
|
15
|
+
return (0, schemas_1.schemaFromTypes)(path_1.default.join(__dirname, 'types.yaml'), {
|
16
|
+
config: 'GeminiAIConfig'
|
17
|
+
});
|
18
|
+
}
|
19
|
+
async create(norsk, cfg, cb, runtime) {
|
20
|
+
const node = new GeminiAINode(norsk, cfg, runtime);
|
21
|
+
await node.initialised;
|
22
|
+
cb(node);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
exports.default = GeminiAIDefinition;
|
26
|
+
class GeminiAINode {
|
27
|
+
norsk;
|
28
|
+
cfg;
|
29
|
+
initialised;
|
30
|
+
logger;
|
31
|
+
gemini;
|
32
|
+
runtime;
|
33
|
+
t0;
|
34
|
+
constructor(norsk, cfg, runtime) {
|
35
|
+
this.norsk = norsk;
|
36
|
+
this.cfg = cfg;
|
37
|
+
this.runtime = runtime;
|
38
|
+
this.logger = new GeminiLogger(cfg.id, runtime);
|
39
|
+
this.initialised = this.initialise();
|
40
|
+
this.t0 = new Date();
|
41
|
+
}
|
42
|
+
get id() { return this.cfg.id; }
|
43
|
+
relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
|
44
|
+
async textDetected(_callMetadata, text) {
|
45
|
+
this.runtime.report.registerInfo(this.cfg.id, text);
|
46
|
+
}
|
47
|
+
async jsonDetected(_callMetadata, jsonString) {
|
48
|
+
console.log("JSON!!!", jsonString);
|
49
|
+
}
|
50
|
+
async initialise() {
|
51
|
+
this.gemini = await this.norsk.processor.control.geminiProcessor({
|
52
|
+
googleApiKey: process_1.env.GOOGLE_API_KEY,
|
53
|
+
model: this.cfg.api == "live" ? "gemini-2.0-flash-exp" : "gemini-2.5-flash",
|
54
|
+
systemInstruction: this.cfg.systemInstruction,
|
55
|
+
functions: [],
|
56
|
+
infoCb: (info) => console.log(`Info: ${info}`),
|
57
|
+
contentCb: this.logger.logContent.bind(this.logger),
|
58
|
+
videoSettings: {
|
59
|
+
frameRate: { frames: 1, seconds: 5 },
|
60
|
+
resolution: { width: 360, height: 280 },
|
61
|
+
},
|
62
|
+
apiChoice: (() => {
|
63
|
+
const apiType = this.cfg.api;
|
64
|
+
switch (apiType) {
|
65
|
+
case "live": return {
|
66
|
+
apiType: "live",
|
67
|
+
};
|
68
|
+
case "traditional": return {
|
69
|
+
apiType: "singleShot",
|
70
|
+
historicalContextMs: 30000,
|
71
|
+
prompt: "In this request, I am sending you an image plus context that you gave from about previous images. Using this information, perform what is requested in the systemInstruction and also return a text-based description of the action in image that I can send back to you on future images to give you some historical context for the current image."
|
72
|
+
};
|
73
|
+
default:
|
74
|
+
return (0, util_1.assertUnreachable)(apiType);
|
75
|
+
}
|
76
|
+
})()
|
77
|
+
});
|
78
|
+
}
|
79
|
+
async subscribe(sources) {
|
80
|
+
const video = sources.find((s) => s.isMedia("video"));
|
81
|
+
const audio = sources.find((s) => s.isMedia("audio"));
|
82
|
+
if (!video || !audio)
|
83
|
+
return;
|
84
|
+
this.gemini?.subscribe([video.select(), audio.select()]);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
class GeminiLogger {
|
88
|
+
id;
|
89
|
+
t0;
|
90
|
+
inTurn;
|
91
|
+
currentStr;
|
92
|
+
runtime;
|
93
|
+
constructor(id, runtime) {
|
94
|
+
this.id = id;
|
95
|
+
this.inTurn = false;
|
96
|
+
this.t0 = new Date();
|
97
|
+
this.currentStr = "";
|
98
|
+
this.runtime = runtime;
|
99
|
+
}
|
100
|
+
logContent(content) {
|
101
|
+
if (content.parts.length > 0) {
|
102
|
+
if (!this.inTurn) {
|
103
|
+
this.currentStr = `${(new Date()).getTime() - this.t0.getTime()}: `;
|
104
|
+
}
|
105
|
+
this.inTurn = true;
|
106
|
+
}
|
107
|
+
content.parts.forEach((part) => {
|
108
|
+
const partType = part.partType;
|
109
|
+
switch (partType) {
|
110
|
+
case "text":
|
111
|
+
{
|
112
|
+
const t = part.value.replace(/```/, '').replace(/text_response\("/, '').replace(/"\)/, '');
|
113
|
+
this.currentStr = this.currentStr + t;
|
114
|
+
}
|
115
|
+
break;
|
116
|
+
case "blob":
|
117
|
+
break;
|
118
|
+
default:
|
119
|
+
exhaustiveCheck(partType);
|
120
|
+
}
|
121
|
+
});
|
122
|
+
if (content.turnComplete && this.inTurn) {
|
123
|
+
this.runtime.report.registerInfo(this.id, this.currentStr);
|
124
|
+
this.inTurn = false;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
}
|
128
|
+
exports.GeminiLogger = GeminiLogger;
|
129
|
+
function exhaustiveCheck(a) {
|
130
|
+
throw new Error(`Unhandled case: ${a}`);
|
131
|
+
}
|
132
|
+
//# sourceMappingURL=runtime.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/processor.gemini-poc/runtime.ts"],"names":[],"mappings":";;;;;;AAqLA,0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I,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC;YACtE,CAAC;YACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACrB,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC/B,QAAQ,QAAQ,EAAE,CAAC;gBACjB,KAAK,MAAM;oBAAE,CAAC;wBACZ,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;wBAC1F,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAA;oBACvC,CAAC;oBACC,MAAM;gBACR,KAAK,MAAM;oBAET,MAAM;gBACR;oBACE,eAAe,CAAC,QAAQ,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACxC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;YAC3D,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,CAAC;IACH,CAAC;CACF;AAjDD,oCAiDC;AAED,SAAgB,eAAe,CAAC,CAAQ;IACtC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
export type paths = Record<string, never>;
|
2
|
+
export type webhooks = Record<string, never>;
|
3
|
+
export interface components {
|
4
|
+
schemas: {
|
5
|
+
GeminiAIConfig: {
|
6
|
+
id: string;
|
7
|
+
displayName: string;
|
8
|
+
systemInstruction: string;
|
9
|
+
api: "live" | "traditional";
|
10
|
+
notes?: string;
|
11
|
+
};
|
12
|
+
GeminiAIState: Record<string, never>;
|
13
|
+
GeminiAICommands: Record<string, never>;
|
14
|
+
GeminiAIEvents: Record<string, never>;
|
15
|
+
};
|
16
|
+
responses: never;
|
17
|
+
parameters: never;
|
18
|
+
requestBodies: never;
|
19
|
+
headers: never;
|
20
|
+
pathItems: never;
|
21
|
+
}
|
22
|
+
export type $defs = Record<string, never>;
|
23
|
+
export type operations = Record<string, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/processor.gemini-poc/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
title: Gemini Replay
|
4
|
+
version: 1.0.0
|
5
|
+
|
6
|
+
components:
|
7
|
+
schemas:
|
8
|
+
GeminiAIConfig:
|
9
|
+
type: object
|
10
|
+
properties:
|
11
|
+
id:
|
12
|
+
type: string
|
13
|
+
displayName:
|
14
|
+
type: string
|
15
|
+
systemInstruction:
|
16
|
+
type: string
|
17
|
+
api:
|
18
|
+
type: string
|
19
|
+
enum: ["live", "traditional"]
|
20
|
+
default: "live"
|
21
|
+
notes:
|
22
|
+
type: string
|
23
|
+
required:
|
24
|
+
- id
|
25
|
+
- displayName
|
26
|
+
- systemInstruction
|
27
|
+
GeminiAIState:
|
28
|
+
type: object
|
29
|
+
required:
|
30
|
+
- enabled
|
31
|
+
properties:
|
32
|
+
|
33
|
+
GeminiAICommands:
|
34
|
+
type: object
|
35
|
+
required:
|
36
|
+
- enabled
|
37
|
+
properties:
|
38
|
+
|
39
|
+
GeminiAIEvents:
|
40
|
+
type: object
|
41
|
+
required:
|
42
|
+
- enabled
|
43
|
+
properties:
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
2
|
+
export default function ({ defineComponent }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<{
|
3
|
+
id: string;
|
4
|
+
displayName: string;
|
5
|
+
notes?: string;
|
6
|
+
}, object, object, object>;
|
7
|
+
export declare function assertUnreachable(_: never): never;
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = default_1;
|
4
|
+
exports.assertUnreachable = assertUnreachable;
|
5
|
+
const FaKey_1 = require("@react-icons/all-files/fa/FaKey");
|
6
|
+
function default_1({ defineComponent }) {
|
7
|
+
return defineComponent({
|
8
|
+
identifier: 'processor.mixMinus',
|
9
|
+
category: 'processor',
|
10
|
+
name: "Mix Minus",
|
11
|
+
description: "Mix n audio streams into n streams, each with every stream except n",
|
12
|
+
icon: FaKey_1.FaKey,
|
13
|
+
subscription: {
|
14
|
+
accepts: {
|
15
|
+
type: 'dynamic-streams',
|
16
|
+
mode: 'any',
|
17
|
+
streams: () => [{ media: 'audio' }]
|
18
|
+
},
|
19
|
+
produces: {
|
20
|
+
type: "dynamic-streams",
|
21
|
+
streams: (cfg, inputs) => {
|
22
|
+
return inputs?.map((s, i) => {
|
23
|
+
const output = { ...s };
|
24
|
+
output.sourceName = `${cfg.id}-${i}`;
|
25
|
+
return output;
|
26
|
+
}) ?? [];
|
27
|
+
},
|
28
|
+
}
|
29
|
+
},
|
30
|
+
configForm: {
|
31
|
+
form: {
|
32
|
+
notes: { help: "Notes about this component", hint: { type: 'text', optional: true } },
|
33
|
+
}
|
34
|
+
}
|
35
|
+
});
|
36
|
+
}
|
37
|
+
function assertUnreachable(_) {
|
38
|
+
throw new Error("Didn't expect to get here");
|
39
|
+
}
|
40
|
+
//# sourceMappingURL=info.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/processor.mixMinus/info.ts"],"names":[],"mappings":";;AAKA,4BAgCC;AAED,8CAEC;AAtCD,2DAAwD;AAExD,mBAAwB,EACtB,eAAe,EACF;IACb,OAAO,eAAe,CAAiB;QACrC,UAAU,EAAE,oBAAoB;QAChC,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,qEAAqE;QAClF,IAAI,EAAE,aAAK;QACX,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,KAAK;gBACX,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;aACpC;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;oBACvB,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;wBAC1B,MAAM,MAAM,GAA2B,EAAE,GAAG,CAAC,EAAE,CAAC;wBAChD,MAAM,CAAC,UAAU,GAAG,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;wBACrC,OAAO,MAAM,CAAC;oBAChB,CAAC,CAAC,IAAI,EAAE,CAAC;gBACX,CAAC;aACF;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,KAAK,EAAE,EAAE,IAAI,EAAE,4BAA4B,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;aACtF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,iBAAiB,CAAC,CAAQ;IACxC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { AudioMixNode, AudioSignalGeneratorNode, Norsk, StreamKeyOverrideNode } from '@norskvideo/norsk-sdk';
|
2
|
+
import { CreatedMediaNode, OnCreated, RelatedMediaNodes, ServerComponentDefinition, ServerComponentSchemas, StudioComponentInputStream } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { components } from './types';
|
4
|
+
export type MixMinusConfig = components['schemas']['MixMinusConfig'];
|
5
|
+
export default class MixMinusDefinition implements ServerComponentDefinition<MixMinusConfig, MixMinus> {
|
6
|
+
schemas(): Promise<ServerComponentSchemas>;
|
7
|
+
create(norsk: Norsk, cfg: MixMinusConfig, cb: OnCreated<MixMinus>): Promise<void>;
|
8
|
+
}
|
9
|
+
export declare class MixMinus implements CreatedMediaNode {
|
10
|
+
static uid: number;
|
11
|
+
norsk: Norsk;
|
12
|
+
cfg: MixMinusConfig;
|
13
|
+
initialised: Promise<void>;
|
14
|
+
id: string;
|
15
|
+
relatedMediaNodes: RelatedMediaNodes;
|
16
|
+
silence?: AudioSignalGeneratorNode;
|
17
|
+
mixers: (AudioMixNode<string> | null)[];
|
18
|
+
skos: (StreamKeyOverrideNode | null)[];
|
19
|
+
static create(norsk: Norsk, cfg: MixMinusConfig): Promise<MixMinus>;
|
20
|
+
constructor(norsk: Norsk, cfg: MixMinusConfig);
|
21
|
+
initialise(): Promise<void>;
|
22
|
+
subscribe(inputs: StudioComponentInputStream[]): Promise<void>;
|
23
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.MixMinus = void 0;
|
7
|
+
const norsk_sdk_1 = require("@norskvideo/norsk-sdk");
|
8
|
+
const runtime_types_1 = require("@norskvideo/norsk-studio/lib/extension/runtime-types");
|
9
|
+
const path_1 = __importDefault(require("path"));
|
10
|
+
const schemas_1 = require("../shared/schemas");
|
11
|
+
class MixMinusDefinition {
|
12
|
+
async schemas() {
|
13
|
+
return (0, schemas_1.schemaFromTypes)(path_1.default.join(__dirname, 'types.yaml'), {
|
14
|
+
config: 'MixMinusConfig'
|
15
|
+
});
|
16
|
+
}
|
17
|
+
async create(norsk, cfg, cb) {
|
18
|
+
const node = await MixMinus.create(norsk, cfg);
|
19
|
+
cb(node);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
exports.default = MixMinusDefinition;
|
23
|
+
class MixMinus {
|
24
|
+
static uid = 0;
|
25
|
+
norsk;
|
26
|
+
cfg;
|
27
|
+
initialised;
|
28
|
+
id;
|
29
|
+
relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
|
30
|
+
silence;
|
31
|
+
mixers = [];
|
32
|
+
skos = [];
|
33
|
+
static async create(norsk, cfg) {
|
34
|
+
const node = new MixMinus(norsk, cfg);
|
35
|
+
await node.initialised;
|
36
|
+
return node;
|
37
|
+
}
|
38
|
+
constructor(norsk, cfg) {
|
39
|
+
this.id = cfg.id;
|
40
|
+
this.cfg = cfg;
|
41
|
+
this.norsk = norsk;
|
42
|
+
this.initialised = this.initialise();
|
43
|
+
}
|
44
|
+
async initialise() {
|
45
|
+
this.silence = await this.norsk.input.audioSignal({
|
46
|
+
id: `${this.id}-silence`,
|
47
|
+
channelLayout: 'mono',
|
48
|
+
sampleRate: 48000,
|
49
|
+
sourceName: `${this.id}-silence`,
|
50
|
+
wave: { type: 'silence' }
|
51
|
+
});
|
52
|
+
}
|
53
|
+
async subscribe(inputs) {
|
54
|
+
await Promise.all(inputs.map(async (_input, i) => {
|
55
|
+
const configSources = inputs.filter((_, a) => a !== i)
|
56
|
+
.map((_, a) => {
|
57
|
+
return { pin: `audio-${a}` };
|
58
|
+
});
|
59
|
+
if (configSources.length == 0) {
|
60
|
+
configSources.push({ pin: "silence" });
|
61
|
+
}
|
62
|
+
if (!this.mixers[i]) {
|
63
|
+
const audioMix = await this.norsk.processor.transform.audioMix({
|
64
|
+
id: `${this.id}-mixer-${i}`,
|
65
|
+
sources: configSources,
|
66
|
+
outputSource: `${this.cfg.id}-${i}`,
|
67
|
+
channelLayout: 'mono'
|
68
|
+
});
|
69
|
+
this.mixers[i] = audioMix;
|
70
|
+
this.relatedMediaNodes.addInput(this.mixers[i]);
|
71
|
+
this.relatedMediaNodes.addOutput(this.mixers[i]);
|
72
|
+
}
|
73
|
+
const sources = inputs
|
74
|
+
.filter((_, a) => a !== i)
|
75
|
+
.map((input, a) => {
|
76
|
+
return input.selectToPin(`audio-${a}`);
|
77
|
+
});
|
78
|
+
sources.push({ source: this.silence, sourceSelector: (0, norsk_sdk_1.audioToPin)("silence") });
|
79
|
+
this.mixers[i].subscribeToPins(sources);
|
80
|
+
this.mixers[i].updateConfig({ sources: configSources });
|
81
|
+
}));
|
82
|
+
}
|
83
|
+
}
|
84
|
+
exports.MixMinus = MixMinus;
|
85
|
+
//# sourceMappingURL=runtime.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/processor.mixMinus/runtime.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAyH;AAEzH,wFAAqM;AACrM,gDAAwB;AAGxB,+CAAoD;AAIpD,MAAqB,kBAAkB;IACrC,KAAK,CAAC,OAAO;QACX,OAAO,IAAA,yBAAe,EAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE;YACzD,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAmB,EAAE,EAAuB;QACrE,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/C,EAAE,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;CACF;AAVD,qCAUC;AAED,MAAa,QAAQ;IACnB,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;IACf,KAAK,CAAQ;IACb,GAAG,CAAiB;IACpB,WAAW,CAAgB;IAC3B,EAAE,CAAS;IACX,iBAAiB,GAAsB,IAAI,iCAAiB,EAAE,CA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AAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;QAE1D,CAAC,CAAC,CAAC,CAAA;IACL,CAAC;;AAhEH,4BAiEC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export type paths = Record<string, never>;
|
2
|
+
export type webhooks = Record<string, never>;
|
3
|
+
export interface components {
|
4
|
+
schemas: {
|
5
|
+
MixMinusConfig: {
|
6
|
+
id: string;
|
7
|
+
displayName: string;
|
8
|
+
notes?: string;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
responses: never;
|
12
|
+
parameters: never;
|
13
|
+
requestBodies: never;
|
14
|
+
headers: never;
|
15
|
+
pathItems: never;
|
16
|
+
}
|
17
|
+
export type $defs = Record<string, never>;
|
18
|
+
export type operations = Record<string, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/processor.mixMinus/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
title: Mix Minus
|
4
|
+
version: 1.0.0
|
5
|
+
|
6
|
+
components:
|
7
|
+
schemas:
|
8
|
+
MixMinusConfig:
|
9
|
+
type: object
|
10
|
+
properties:
|
11
|
+
id:
|
12
|
+
type: string
|
13
|
+
displayName:
|
14
|
+
type: string
|
15
|
+
notes:
|
16
|
+
type: string
|
17
|
+
required:
|
18
|
+
- id
|
19
|
+
- displayName
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type { MonetiseOutputCommand, MonetiseOutputEvent, MonetiseOutputSettings, MonetiseOutputState } from "./runtime";
|
2
|
+
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
3
|
+
export default function (R: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<MonetiseOutputSettings, MonetiseOutputState, MonetiseOutputCommand, MonetiseOutputEvent>;
|
@@ -0,0 +1,72 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.default = default_1;
|
7
|
+
const config_1 = require("@norskvideo/norsk-studio/lib/shared/config");
|
8
|
+
const summary_1 = __importDefault(require("./summary"));
|
9
|
+
function default_1(R) {
|
10
|
+
const { defineComponent, } = R;
|
11
|
+
return defineComponent({
|
12
|
+
identifier: 'processor.scte35inject',
|
13
|
+
category: 'processor',
|
14
|
+
name: "SCTE35 Inject",
|
15
|
+
description: "Injects SCTE-35 markers into audio and video streams for ad insertion and monetization",
|
16
|
+
subscription: {
|
17
|
+
accepts: {
|
18
|
+
type: "simple-stream",
|
19
|
+
audio: true,
|
20
|
+
video: true
|
21
|
+
},
|
22
|
+
produces: {
|
23
|
+
type: 'simple-stream',
|
24
|
+
audio: true,
|
25
|
+
video: true,
|
26
|
+
ancillary: true
|
27
|
+
}
|
28
|
+
},
|
29
|
+
extraValidation: (ctx) => {
|
30
|
+
ctx.requireExactVideo(1);
|
31
|
+
ctx.requireExactAudio(1);
|
32
|
+
},
|
33
|
+
display: (_desc) => { return {}; },
|
34
|
+
runtime: {
|
35
|
+
initialState: () => ({}),
|
36
|
+
handleEvent(ev, state) {
|
37
|
+
const evType = ev.type;
|
38
|
+
switch (evType) {
|
39
|
+
case 'url-published':
|
40
|
+
state.url = ev.url;
|
41
|
+
break;
|
42
|
+
case 'advert-started':
|
43
|
+
state.currentAdvert = { timeLeftMs: ev.durationMs };
|
44
|
+
break;
|
45
|
+
case 'advert-tick':
|
46
|
+
state.currentAdvert = { timeLeftMs: ev.timeLeftMs };
|
47
|
+
break;
|
48
|
+
case 'advert-finished':
|
49
|
+
state.currentAdvert = undefined;
|
50
|
+
break;
|
51
|
+
default:
|
52
|
+
assertUnreachable(evType);
|
53
|
+
}
|
54
|
+
return { ...state };
|
55
|
+
},
|
56
|
+
summary: summary_1.default
|
57
|
+
},
|
58
|
+
configForm: {
|
59
|
+
global: {
|
60
|
+
iceServers: (0, config_1.GlobalIceServers)(R),
|
61
|
+
hardware: (0, config_1.HardwareSelection)()
|
62
|
+
},
|
63
|
+
form: {
|
64
|
+
notes: { help: "Notes about this component", hint: { type: 'text', optional: true } },
|
65
|
+
}
|
66
|
+
}
|
67
|
+
});
|
68
|
+
}
|
69
|
+
function assertUnreachable(_) {
|
70
|
+
throw new Error("Didn't expect to get here");
|
71
|
+
}
|
72
|
+
//# sourceMappingURL=info.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/processor.monetise/info.ts"],"names":[],"mappings":";;;;;AAKA,4BA8DC;AAjED,uEAAiG;AACjG,wDAAoC;AAEpC,mBAAwB,CAAe;IACrC,MAAM,EACJ,eAAe,GAChB,GAAG,CAAC,CAAC;IAEN,OAAO,eAAe,CAA0F;QAC9G,UAAU,EAAE,wBAAwB;QACpC,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,wFAAwF;QACrG,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;aACZ;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;gBACX,SAAS,EAAE,IAAI;aAChB;SACF;QACD,eAAe,EAAE,CAAC,GAAG,EAAE,EAAE;YACvB,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;YACzB,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC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ode } from '@norskvideo/norsk-sdk';
|
2
|
+
import { InstanceRouteInfo, OnCreated, RuntimeUpdates, ServerComponentDefinition, ServerComponentSchemas, StudioComponentInputStream, StudioRuntime, StudioShared } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { CustomAutoDuplexNode } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
|
+
import { HardwareAccelerationType, IceServer } from '@norskvideo/norsk-studio/lib/shared/config';
|
5
|
+
import { components } from './types';
|
6
|
+
export type MonetiseOutputSettings = {
|
7
|
+
id: string;
|
8
|
+
displayName: string;
|
9
|
+
__global: {
|
10
|
+
iceServers: IceServer[];
|
11
|
+
hardware?: HardwareAccelerationType;
|
12
|
+
};
|
13
|
+
notes?: string;
|
14
|
+
};
|
15
|
+
export type MonetiseOutputState = {
|
16
|
+
url?: string;
|
17
|
+
currentAdvert?: {
|
18
|
+
timeLeftMs: number;
|
19
|
+
};
|
20
|
+
};
|
21
|
+
export type MonetiseOutputEvent = {
|
22
|
+
type: 'url-published';
|
23
|
+
url: string;
|
24
|
+
} | {
|
25
|
+
type: 'advert-started';
|
26
|
+
durationMs: number;
|
27
|
+
} | {
|
28
|
+
type: 'advert-tick';
|
29
|
+
timeLeftMs: number;
|
30
|
+
} | {
|
31
|
+
type: 'advert-finished';
|
32
|
+
};
|
33
|
+
export type MonetiseOutputCommand = {
|
34
|
+
type: 'inject-advert';
|
35
|
+
durationMs: number;
|
36
|
+
};
|
37
|
+
export type MonetiseHttpInject = components['schemas']['inject'];
|
38
|
+
export default class MonetiseDefinition implements ServerComponentDefinition<MonetiseOutputSettings, MonetiseOutput, MonetiseOutputState, MonetiseOutputCommand, MonetiseOutputEvent> {
|
39
|
+
create(norsk: Norsk, cfg: MonetiseOutputSettings, cb: OnCreated<MonetiseOutput>, runtime: StudioRuntime<MonetiseOutputState, MonetiseOutputCommand, MonetiseOutputEvent>): Promise<void>;
|
40
|
+
schemas(): Promise<ServerComponentSchemas>;
|
41
|
+
handleCommand(node: MonetiseOutput, command: MonetiseOutputCommand): void;
|
42
|
+
instanceRoutes(): Promise<InstanceRouteInfo<MonetiseOutputSettings, MonetiseOutput, MonetiseOutputState, MonetiseOutputCommand, MonetiseOutputEvent>[]>;
|
43
|
+
}
|
44
|
+
declare class MonetiseOutput extends CustomAutoDuplexNode {
|
45
|
+
initialised: Promise<void>;
|
46
|
+
norsk: Norsk;
|
47
|
+
updates: RuntimeUpdates<MonetiseOutputState, MonetiseOutputCommand, MonetiseOutputEvent>;
|
48
|
+
shared: StudioShared;
|
49
|
+
cfg: MonetiseOutputSettings;
|
50
|
+
encoder?: SourceMediaNode;
|
51
|
+
whep?: WhepOutputNode;
|
52
|
+
delayed?: JitterBufferNode;
|
53
|
+
ancillary?: AncillaryNode;
|
54
|
+
output?: StreamMetadataOverrideNode;
|
55
|
+
start: Date;
|
56
|
+
constructor(norsk: Norsk, runtime: StudioRuntime<MonetiseOutputState, MonetiseOutputCommand, MonetiseOutputEvent>, cfg: MonetiseOutputSettings);
|
57
|
+
initialise(): Promise<void>;
|
58
|
+
injectAdvert(durationMs: number): void;
|
59
|
+
subscribe(sources: StudioComponentInputStream[]): Promise<void>;
|
60
|
+
setupPreview(sources: StudioComponentInputStream[]): Promise<void>;
|
61
|
+
}
|
62
|
+
export {};
|