@norskvideo/norsk-studio-built-ins 1.6.2 → 1.7.0
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/client/info.js +251 -981
- package/client/processor.audioLevel/styles.css +164 -0
- package/client/processor.audioMixer/styles.css +249 -0
- package/lib/info.js +21 -27
- package/lib/info.js.map +1 -1
- package/lib/input.rtmp/info.js +1 -1
- package/lib/input.udp-ts/runtime.js +1 -13
- package/lib/input.udp-ts/runtime.js.map +1 -1
- package/lib/output.autoCmaf/runtime.js +29 -4
- package/lib/output.autoCmaf/runtime.js.map +1 -1
- package/lib/output.preview/runtime.d.ts +19 -3
- package/lib/output.preview/runtime.js +51 -25
- package/lib/output.preview/runtime.js.map +1 -1
- package/lib/processor.actionReplay/info.d.ts +5 -0
- package/lib/processor.actionReplay/info.js +100 -0
- package/lib/processor.actionReplay/info.js.map +1 -0
- package/lib/processor.actionReplay/runtime.d.ts +59 -0
- package/lib/processor.actionReplay/runtime.js +224 -0
- package/lib/processor.actionReplay/runtime.js.map +1 -0
- package/lib/processor.actionReplay/summary.d.ts +7 -0
- package/lib/processor.actionReplay/summary.js +76 -0
- package/lib/processor.actionReplay/summary.js.map +1 -0
- package/lib/processor.audioLevel/info.d.ts +3 -0
- package/lib/processor.audioLevel/info.js +83 -0
- package/lib/processor.audioLevel/info.js.map +1 -0
- package/lib/processor.audioLevel/inline-view.d.ts +6 -0
- package/lib/processor.audioLevel/inline-view.js +23 -0
- package/lib/processor.audioLevel/inline-view.js.map +1 -0
- package/lib/processor.audioLevel/runtime.d.ts +49 -0
- package/lib/processor.audioLevel/runtime.js +82 -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 +36 -0
- package/lib/processor.audioLevel/summary-view.js.map +1 -0
- package/lib/processor.audioMixer/fullscreen-view.d.ts +8 -0
- package/lib/processor.audioMixer/fullscreen-view.js +121 -0
- package/lib/processor.audioMixer/fullscreen-view.js.map +1 -0
- package/lib/processor.audioMixer/info.d.ts +4 -0
- package/lib/processor.audioMixer/info.js +148 -0
- package/lib/processor.audioMixer/info.js.map +1 -0
- package/lib/processor.audioMixer/inline-view.d.ts +7 -0
- package/lib/processor.audioMixer/inline-view.js +43 -0
- package/lib/processor.audioMixer/inline-view.js.map +1 -0
- package/lib/processor.audioMixer/runtime.d.ts +119 -0
- package/lib/processor.audioMixer/runtime.js +142 -0
- package/lib/processor.audioMixer/runtime.js.map +1 -0
- package/lib/processor.audioMixer/summary-view.d.ts +7 -0
- package/lib/processor.audioMixer/summary-view.js +11 -0
- package/lib/processor.audioMixer/summary-view.js.map +1 -0
- package/lib/processor.browserOverlay/runtime.d.ts +11 -7
- package/lib/processor.browserOverlay/runtime.js +83 -78
- package/lib/processor.browserOverlay/runtime.js.map +1 -1
- package/lib/processor.dynamicBug/runtime.d.ts +7 -3
- package/lib/processor.dynamicBug/runtime.js +94 -64
- package/lib/processor.dynamicBug/runtime.js.map +1 -1
- package/lib/processor.dynamicBug/summary-view.d.ts +2 -6
- package/lib/processor.dynamicBug/summary-view.js.map +1 -1
- package/lib/processor.fixedLadder/info.d.ts +6 -1
- package/lib/processor.fixedLadder/info.js +6 -1
- package/lib/processor.fixedLadder/info.js.map +1 -1
- package/lib/processor.fixedLadder/newFile.d.ts +3 -0
- package/lib/processor.fixedLadder/newFile.js +145 -0
- package/lib/processor.fixedLadder/newFile.js.map +1 -0
- package/lib/processor.monetise/info.d.ts +3 -0
- package/lib/processor.monetise/info.js +90 -0
- package/lib/processor.monetise/info.js.map +1 -0
- package/lib/processor.monetise/runtime.d.ts +57 -0
- package/lib/processor.monetise/runtime.js +141 -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 +39 -0
- package/lib/processor.monetise/summary.js.map +1 -0
- package/lib/test/audio-mixer.d.ts +0 -0
- package/lib/test/audio-mixer.js +2 -0
- package/lib/test/audio-mixer.js.map +1 -0
- package/lib/test/auto-cmaf.js +198 -6
- package/lib/test/auto-cmaf.js.map +1 -1
- package/lib/test/browser-overlay.js +53 -0
- package/lib/test/browser-overlay.js.map +1 -1
- package/lib/test/dynamic-bug.d.ts +1 -0
- package/lib/test/dynamic-bug.js +313 -0
- package/lib/test/dynamic-bug.js.map +1 -0
- package/lib/test/fixed-ladder.d.ts +1 -0
- package/lib/test/fixed-ladder.js +125 -0
- package/lib/test/fixed-ladder.js.map +1 -1
- package/lib/test/preview.d.ts +1 -0
- package/lib/test/preview.js +112 -0
- package/lib/test/preview.js.map +1 -0
- package/lib/test/rtmp-input.js +62 -31
- package/lib/test/rtmp-input.js.map +1 -1
- package/lib/test/rtmp-output.js +18 -4
- package/lib/test/rtmp-output.js.map +1 -1
- package/lib/test/srt-input-caller.js +50 -0
- package/lib/test/srt-input-caller.js.map +1 -1
- package/lib/test/whep-output.js +52 -5
- package/lib/test/whep-output.js.map +1 -1
- package/package.json +3 -7
@@ -1,7 +1,8 @@
|
|
1
|
-
import { Norsk, WhepOutputSettings as SdkSettings } from '@norskvideo/norsk-sdk';
|
2
|
-
import { OnCreated, ServerComponentDefinition, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
-
import { SimpleSinkWrapper } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
1
|
+
import { AudioMeasureLevelsNode, Norsk, WhepOutputSettings as SdkSettings, SourceMediaNode, WhepOutputNode } from '@norskvideo/norsk-sdk';
|
2
|
+
import { OnCreated, RuntimeUpdates, ServerComponentDefinition, StudioNodeSubscriptionSource, StudioRuntime, StudioShared } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { CustomSinkNode, SimpleSinkWrapper, SubscriptionOpts } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
4
|
import { HardwareAccelerationType, IceServer } from '@norskvideo/norsk-studio/lib/shared/config';
|
5
|
+
import { ContextPromiseControl } from '@norskvideo/norsk-studio/lib/runtime/util';
|
5
6
|
export type PreviewOutputSettings = {
|
6
7
|
id: string;
|
7
8
|
displayName: string;
|
@@ -32,3 +33,18 @@ export type PreviewOutputCommand = object;
|
|
32
33
|
export default class WhepOutputDefinition implements ServerComponentDefinition<PreviewOutputSettings, SimpleSinkWrapper, PreviewOutputState, PreviewOutputCommand, PreviewOutputEvent> {
|
33
34
|
create(norsk: Norsk, cfg: PreviewOutputSettings, cb: OnCreated<SimpleSinkWrapper>, runtime: StudioRuntime<PreviewOutputState, PreviewOutputEvent>): Promise<void>;
|
34
35
|
}
|
36
|
+
export declare class PreviewOutput extends CustomSinkNode {
|
37
|
+
initialised: Promise<void>;
|
38
|
+
norsk: Norsk;
|
39
|
+
updates: RuntimeUpdates<PreviewOutputState, PreviewOutputEvent>;
|
40
|
+
shared: StudioShared;
|
41
|
+
cfg: PreviewOutputSettings;
|
42
|
+
encoder?: SourceMediaNode;
|
43
|
+
whep?: WhepOutputNode;
|
44
|
+
audioLevels?: AudioMeasureLevelsNode;
|
45
|
+
context: ContextPromiseControl;
|
46
|
+
constructor(norsk: Norsk, { updates, shared }: StudioRuntime<PreviewOutputState, PreviewOutputEvent>, cfg: PreviewOutputSettings);
|
47
|
+
initialise(): Promise<void>;
|
48
|
+
subscribe(sources: StudioNodeSubscriptionSource[], _opts?: SubscriptionOpts | undefined): void;
|
49
|
+
subscribeImpl(sources: StudioNodeSubscriptionSource[]): Promise<void>;
|
50
|
+
}
|
@@ -1,9 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.PreviewOutput = void 0;
|
3
4
|
const norsk_sdk_1 = require("@norskvideo/norsk-sdk");
|
4
5
|
const base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
|
5
6
|
const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
|
6
7
|
const webrtcSettings_1 = require("../shared/webrtcSettings");
|
8
|
+
const util_1 = require("@norskvideo/norsk-studio/lib/runtime/util");
|
7
9
|
class WhepOutputDefinition {
|
8
10
|
async create(norsk, cfg, cb, runtime) {
|
9
11
|
const node = new PreviewOutput(norsk, runtime, cfg);
|
@@ -21,6 +23,7 @@ class PreviewOutput extends base_nodes_1.CustomSinkNode {
|
|
21
23
|
encoder;
|
22
24
|
whep;
|
23
25
|
audioLevels;
|
26
|
+
context = new util_1.ContextPromiseControl(this.subscribeImpl.bind(this));
|
24
27
|
constructor(norsk, { updates, shared }, cfg) {
|
25
28
|
super(cfg.id);
|
26
29
|
this.cfg = cfg;
|
@@ -30,18 +33,6 @@ class PreviewOutput extends base_nodes_1.CustomSinkNode {
|
|
30
33
|
this.initialised = this.initialise();
|
31
34
|
}
|
32
35
|
async initialise() {
|
33
|
-
const whepCfg = {
|
34
|
-
id: `${this.cfg.id}-whep`,
|
35
|
-
bufferDelayMs: this.cfg.bufferDelayMs,
|
36
|
-
onPublishStart: () => {
|
37
|
-
const url = this.whep?.endpointUrl;
|
38
|
-
if (url) {
|
39
|
-
this.updates.raiseEvent({ type: 'url-published', url });
|
40
|
-
}
|
41
|
-
},
|
42
|
-
...(0, webrtcSettings_1.webRtcSettings)(this.cfg.__global.iceServers)
|
43
|
-
};
|
44
|
-
this.whep = await this.norsk.output.whep(whepCfg);
|
45
36
|
this.audioLevels = await this.norsk.processor.control.audioMeasureLevels({
|
46
37
|
id: `${this.cfg.id}-audiolevels`,
|
47
38
|
onData: (levels) => {
|
@@ -59,29 +50,64 @@ class PreviewOutput extends base_nodes_1.CustomSinkNode {
|
|
59
50
|
});
|
60
51
|
}
|
61
52
|
});
|
62
|
-
this.registerInput(this.whep);
|
63
53
|
this.registerInput(this.audioLevels);
|
64
54
|
}
|
65
55
|
subscribe(sources, _opts) {
|
66
|
-
|
56
|
+
this.context.setSources(sources);
|
67
57
|
}
|
68
58
|
async subscribeImpl(sources) {
|
69
|
-
const videoSource = sources.filter((s) => s.streams.select.includes("video"))
|
70
|
-
const audioSource = sources.filter((s) => s.streams.select.includes("audio"))
|
71
|
-
if (
|
72
|
-
|
73
|
-
|
74
|
-
|
59
|
+
const videoSource = sources.filter((s) => s.streams.select.includes("video")).at(0);
|
60
|
+
const audioSource = sources.filter((s) => s.streams.select.includes("audio")).at(0);
|
61
|
+
if (videoSource) {
|
62
|
+
if (!this.encoder) {
|
63
|
+
(0, logging_1.debuglog)("Finding preview encode for preview node", this.id);
|
64
|
+
this.encoder = await this.shared.previewEncode(videoSource.selectVideo()[0], this.cfg.__global.hardware);
|
65
|
+
this.registerInput(this.encoder);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
else {
|
69
|
+
this.encoder = undefined;
|
70
|
+
}
|
71
|
+
if (audioSource) {
|
72
|
+
this.audioLevels?.subscribe(audioSource.selectAudio());
|
73
|
+
}
|
74
|
+
else {
|
75
|
+
this.audioLevels?.subscribe([]);
|
75
76
|
}
|
76
|
-
|
77
|
-
|
77
|
+
const subscriptions = [];
|
78
|
+
if (this.encoder) {
|
79
|
+
subscriptions.push({
|
78
80
|
source: this.encoder,
|
79
81
|
sourceSelector: norsk_sdk_1.selectVideo
|
80
|
-
}
|
81
|
-
|
82
|
+
});
|
83
|
+
}
|
84
|
+
if (audioSource) {
|
82
85
|
subscriptions.push(audioSource.selectAudio()[0]);
|
83
86
|
}
|
84
|
-
|
87
|
+
const whepCfg = {
|
88
|
+
id: `${this.cfg.id}-whep`,
|
89
|
+
bufferDelayMs: this.cfg.bufferDelayMs,
|
90
|
+
onPublishStart: () => {
|
91
|
+
const url = this.whep?.endpointUrl;
|
92
|
+
if (url) {
|
93
|
+
this.updates.raiseEvent({ type: 'url-published', url });
|
94
|
+
}
|
95
|
+
},
|
96
|
+
...(0, webrtcSettings_1.webRtcSettings)(this.cfg.__global.iceServers)
|
97
|
+
};
|
98
|
+
if (!this.whep && subscriptions.length > 0) {
|
99
|
+
this.whep = await this.norsk.output.whep(whepCfg);
|
100
|
+
this.whep?.subscribe(subscriptions, (ctx) => ctx.streams.length == subscriptions.length);
|
101
|
+
}
|
102
|
+
if (subscriptions.length == 0) {
|
103
|
+
await this.whep?.close();
|
104
|
+
this.whep = undefined;
|
105
|
+
this.updates.update({});
|
106
|
+
}
|
107
|
+
if (subscriptions.length == 1 && !audioSource) {
|
108
|
+
this.updates.update({ url: this.whep?.endpointUrl });
|
109
|
+
}
|
85
110
|
}
|
86
111
|
}
|
112
|
+
exports.PreviewOutput = PreviewOutput;
|
87
113
|
//# sourceMappingURL=runtime.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.preview/runtime.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.preview/runtime.ts"],"names":[],"mappings":";;;AAAA,qDAG+B;AAE/B,kFAAwH;AAExH,yEAAuE;AACvE,6DAA0D;AAC1D,oEAAkF;AAkClF,MAAqB,oBAAoB;IACvC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAA0B,EAAE,EAAgC,EAAE,OAA8D;QACrJ,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpD,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,EAAE,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;CACF;AAND,uCAMC;AAED,MAAa,aAAc,SAAQ,2BAAc;IAC/C,WAAW,CAAgB;IAC3B,KAAK,CAAQ;IACb,OAAO,CAAyD;IAChE,MAAM,CAAe;IAErB,GAAG,CAAwB;IAC3B,OAAO,CAAmB;IAC1B,IAAI,CAAkB;IACtB,WAAW,CAA0B;IACrC,OAAO,GAA0B,IAAI,4BAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1F,YAAY,KAAY,EAAE,EAAE,OAAO,EAAE,MAAM,EAAyD,EAAE,GAA0B;QAC9H,KAAK,CAAC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AC;QAC3F,CAAC;QAED,IAAI,aAAa,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;YACtB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACzB,CAAC;QACD,IAAI,aAAa,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;CACF;AAhHD,sCAgHC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
2
|
+
import type { ActionReplayConfig, ActionReplayState, ActionReplayCommand, ActionReplayEvent } from "./runtime";
|
3
|
+
export default function ({ defineComponent, assertUnreachable, Av, }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<ActionReplayConfig, ActionReplayState, ActionReplayCommand, ActionReplayEvent>;
|
4
|
+
export declare const hardwareNames: readonly ["quadra", "nvidia"];
|
5
|
+
export type HardwareName = typeof hardwareNames[number];
|
@@ -0,0 +1,100 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
exports.hardwareNames = void 0;
|
30
|
+
const react_1 = __importDefault(require("react"));
|
31
|
+
const config_1 = require("@norskvideo/norsk-studio/lib/shared/config");
|
32
|
+
function default_1({ defineComponent, assertUnreachable, Av, }) {
|
33
|
+
const SummaryView = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./summary'))));
|
34
|
+
return defineComponent({
|
35
|
+
identifier: 'processor.transform.actionReplay',
|
36
|
+
category: 'processor',
|
37
|
+
name: "Action Replay",
|
38
|
+
subscription: {
|
39
|
+
accepts: {
|
40
|
+
type: 'single-stream',
|
41
|
+
media: Av
|
42
|
+
},
|
43
|
+
produces: {
|
44
|
+
type: 'single-stream',
|
45
|
+
media: Av
|
46
|
+
},
|
47
|
+
},
|
48
|
+
extraValidation: (ctx) => {
|
49
|
+
if (ctx.subscriptions.length == 0) {
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
if (ctx.subscriptions.length > 1) {
|
53
|
+
ctx.addError("Action replay can only subscribe to a single source");
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
if (!ctx.subscriptions[0].streams.select.includes("audio")) {
|
57
|
+
ctx.addError("Action replay requires audio in the subscription");
|
58
|
+
}
|
59
|
+
if (!ctx.subscriptions[0].streams.select.includes("video")) {
|
60
|
+
ctx.addError("Action replay requires video in the subscription");
|
61
|
+
}
|
62
|
+
},
|
63
|
+
runtime: {
|
64
|
+
summary: SummaryView,
|
65
|
+
initialState: () => ({
|
66
|
+
replaying: false,
|
67
|
+
contentPlayerUrl: undefined
|
68
|
+
}),
|
69
|
+
handleEvent: (ev, state) => {
|
70
|
+
const evType = ev.type;
|
71
|
+
switch (evType) {
|
72
|
+
case "content-player-created":
|
73
|
+
return { ...state, contentPlayerUrl: ev.url };
|
74
|
+
case "replay-started":
|
75
|
+
return { ...state, replaying: true };
|
76
|
+
case "replay-finished":
|
77
|
+
return { ...state, replaying: false };
|
78
|
+
default:
|
79
|
+
return assertUnreachable(evType);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
},
|
83
|
+
display: (desc) => {
|
84
|
+
const { __global: _, ...rem } = desc.config;
|
85
|
+
return rem;
|
86
|
+
},
|
87
|
+
configForm: {
|
88
|
+
global: {
|
89
|
+
hardware: (0, config_1.HardwareSelection)()
|
90
|
+
},
|
91
|
+
form: {}
|
92
|
+
}
|
93
|
+
});
|
94
|
+
}
|
95
|
+
exports.default = default_1;
|
96
|
+
exports.hardwareNames = [
|
97
|
+
'quadra',
|
98
|
+
'nvidia'
|
99
|
+
];
|
100
|
+
//# sourceMappingURL=info.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/processor.actionReplay/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kDAA0B;AAC1B,uEAA+E;AAG/E,mBAAwB,EACtB,eAAe,EACf,iBAAiB,EACjB,EAAE,GACW;IACb,MAAM,WAAW,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,WAAW,GAAC,CAAC,CAAC;IAEhE,OAAO,eAAe,CAAgF;QACpG,UAAU,EAAE,kCAAkC;QAC9C,QA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AAC,GAAG,EAAE,CAAA;oBAC/C,KAAK,gBAAgB;wBACnB,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;oBACtC,KAAK,iBAAiB;wBACpB,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAA;oBACvC;wBACE,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC;SACF;QACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5C,OAAO,GAAG,CAAC;QACb,CAAC;QACD,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,QAAQ,EAAE,IAAA,0BAAiB,GAAE;aAC9B;YACD,IAAI,EAAE,EACL;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAlED,4BAkEC;AAEY,QAAA,aAAa,GAAG;IAC3B,QAAQ;IACR,QAAQ;CACA,CAAA"}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { AudioEncodeNode, CmafAudioOutputNode, CmafMultiVariantOutputNode, CmafVideoOutputNode, FrameStorePlayerNode, FrameStoreRecorderNode, Norsk, SourceMediaNode, StreamKey, StreamMetadataOverrideNode, StreamSwitchSmoothNode, SubscriptionError } from '@norskvideo/norsk-sdk';
|
2
|
+
import { OnCreated, RelatedMediaNodes, RuntimeUpdates, ServerComponentDefinition, StudioNodeSubscriptionSource, StudioRuntime, StudioShared } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { SubscriptionOpts } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
|
+
import { HardwareAccelerationType } from '@norskvideo/norsk-studio/lib/shared/config';
|
5
|
+
export type ActionReplayConfig = {
|
6
|
+
id: string;
|
7
|
+
displayName: string;
|
8
|
+
__global: {
|
9
|
+
hardware?: HardwareAccelerationType;
|
10
|
+
};
|
11
|
+
};
|
12
|
+
export type ActionReplayState = {
|
13
|
+
contentPlayerUrl?: string;
|
14
|
+
replaying: boolean;
|
15
|
+
};
|
16
|
+
export type ActionReplayEvent = {
|
17
|
+
type: 'content-player-created';
|
18
|
+
url: string;
|
19
|
+
} | {
|
20
|
+
type: 'replay-started';
|
21
|
+
} | {
|
22
|
+
type: 'replay-finished';
|
23
|
+
};
|
24
|
+
export type ActionReplayCommand = {
|
25
|
+
type: 'do-replay';
|
26
|
+
from: number;
|
27
|
+
duration: number;
|
28
|
+
};
|
29
|
+
export default class ActionReplayDefinition implements ServerComponentDefinition<ActionReplayConfig, ActionReplay, ActionReplayState, ActionReplayCommand, ActionReplayEvent> {
|
30
|
+
create(norsk: Norsk, cfg: ActionReplayConfig, cb: OnCreated<ActionReplay>, runtime: StudioRuntime<ActionReplayState, ActionReplayEvent>): Promise<void>;
|
31
|
+
handleCommand(node: ActionReplay, command: ActionReplayCommand): void;
|
32
|
+
}
|
33
|
+
export declare class ActionReplay {
|
34
|
+
id: string;
|
35
|
+
norsk: Norsk;
|
36
|
+
cfg: ActionReplayConfig;
|
37
|
+
initialised: Promise<void>;
|
38
|
+
updates: RuntimeUpdates<ActionReplayState, ActionReplayEvent>;
|
39
|
+
shared: StudioShared;
|
40
|
+
relatedMediaNodes: RelatedMediaNodes;
|
41
|
+
smooth?: StreamSwitchSmoothNode<'source' | 'replay'>;
|
42
|
+
audioEncode?: AudioEncodeNode;
|
43
|
+
videoEncode?: SourceMediaNode;
|
44
|
+
audioCmaf?: CmafAudioOutputNode;
|
45
|
+
videoCmaf?: CmafVideoOutputNode;
|
46
|
+
mvCmaf?: CmafMultiVariantOutputNode;
|
47
|
+
writer?: FrameStoreRecorderNode;
|
48
|
+
reader?: FrameStorePlayerNode;
|
49
|
+
currentSource?: StudioNodeSubscriptionSource;
|
50
|
+
passthrough?: StreamMetadataOverrideNode;
|
51
|
+
audioStreamKey?: StreamKey;
|
52
|
+
videoStreamKey?: StreamKey;
|
53
|
+
constructor(norsk: Norsk, cfg: ActionReplayConfig, runtime: StudioRuntime<ActionReplayState, ActionReplayEvent>);
|
54
|
+
initialise(): Promise<void>;
|
55
|
+
subscribe(sources: StudioNodeSubscriptionSource[], _opts?: SubscriptionOpts | undefined): void;
|
56
|
+
replay(from: number, duration: number): Promise<void>;
|
57
|
+
sourceContextChange(_responseCallback: (error?: SubscriptionError) => void): Promise<boolean>;
|
58
|
+
teardown(): void;
|
59
|
+
}
|
@@ -0,0 +1,224 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ActionReplay = void 0;
|
4
|
+
const norsk_sdk_1 = require("@norskvideo/norsk-sdk");
|
5
|
+
const runtime_types_1 = require("@norskvideo/norsk-studio/lib/extension/runtime-types");
|
6
|
+
const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
|
7
|
+
const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
|
8
|
+
const os_1 = require("os");
|
9
|
+
const config_1 = require("@norskvideo/norsk-studio/lib/shared/config");
|
10
|
+
class ActionReplayDefinition {
|
11
|
+
async create(norsk, cfg, cb, runtime) {
|
12
|
+
const node = new ActionReplay(norsk, cfg, runtime);
|
13
|
+
await node.initialised;
|
14
|
+
cb(node);
|
15
|
+
}
|
16
|
+
handleCommand(node, command) {
|
17
|
+
const cmdType = command.type;
|
18
|
+
switch (cmdType) {
|
19
|
+
case 'do-replay':
|
20
|
+
void node.replay(command.from, command.duration);
|
21
|
+
break;
|
22
|
+
default:
|
23
|
+
(0, util_1.assertUnreachable)(cmdType);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
exports.default = ActionReplayDefinition;
|
28
|
+
class ActionReplay {
|
29
|
+
id;
|
30
|
+
norsk;
|
31
|
+
cfg;
|
32
|
+
initialised;
|
33
|
+
updates;
|
34
|
+
shared;
|
35
|
+
relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
|
36
|
+
smooth;
|
37
|
+
audioEncode;
|
38
|
+
videoEncode;
|
39
|
+
audioCmaf;
|
40
|
+
videoCmaf;
|
41
|
+
mvCmaf;
|
42
|
+
writer;
|
43
|
+
reader;
|
44
|
+
currentSource;
|
45
|
+
passthrough;
|
46
|
+
audioStreamKey;
|
47
|
+
videoStreamKey;
|
48
|
+
constructor(norsk, cfg, runtime) {
|
49
|
+
this.id = cfg.id;
|
50
|
+
this.norsk = norsk;
|
51
|
+
this.cfg = cfg;
|
52
|
+
this.updates = runtime.updates;
|
53
|
+
this.shared = runtime.shared;
|
54
|
+
this.initialised = this.initialise();
|
55
|
+
}
|
56
|
+
async initialise() {
|
57
|
+
this.passthrough = await this.norsk.processor.transform.streamMetadataOverride({
|
58
|
+
id: `${this.id}-output`,
|
59
|
+
});
|
60
|
+
this.relatedMediaNodes.addOutput(this.passthrough);
|
61
|
+
}
|
62
|
+
subscribe(sources, _opts) {
|
63
|
+
this.currentSource = sources[0];
|
64
|
+
this.currentSource.registerForContextChange(this);
|
65
|
+
void this.sourceContextChange(() => { });
|
66
|
+
}
|
67
|
+
async replay(from, duration) {
|
68
|
+
if (this.reader) {
|
69
|
+
(0, logging_1.debuglog)("Multiple replay attempts started, ignoring", { from, duration });
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
if (!this.smooth || !this.currentSource || !this.currentSource.source.relatedMediaNodes.output) {
|
73
|
+
(0, logging_1.errorlog)("Attempt to do replay before node is set up???", { from, duration });
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
if (!this.audioStreamKey || !this.videoStreamKey) {
|
77
|
+
(0, logging_1.errorlog)("Attempt to do replay with no known stream keys", { from, duration });
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
this.updates.raiseEvent({
|
81
|
+
type: 'replay-started'
|
82
|
+
});
|
83
|
+
const smooth = this.smooth;
|
84
|
+
const currentSource = this.currentSource;
|
85
|
+
this.reader = await this.norsk.input.frameStore({
|
86
|
+
id: `${this.id}-reader`,
|
87
|
+
name: `${this.id}-store`,
|
88
|
+
streamSelection: [
|
89
|
+
this.videoStreamKey,
|
90
|
+
this.audioStreamKey
|
91
|
+
],
|
92
|
+
cuts: [{
|
93
|
+
durationMs: duration * 1000,
|
94
|
+
startDateTime: new Date((new Date()).getTime() - (from * 1000))
|
95
|
+
}],
|
96
|
+
trimPartialSegments: true,
|
97
|
+
sourceName: `${this.id}-cut`,
|
98
|
+
onCreate: (node) => {
|
99
|
+
smooth.subscribeToPins(currentSource.selectAvToPin("source").concat([
|
100
|
+
{ source: node, sourceSelector: (0, norsk_sdk_1.avToPin)("replay") }
|
101
|
+
]));
|
102
|
+
},
|
103
|
+
onClose: () => {
|
104
|
+
this.reader = undefined;
|
105
|
+
this.updates.raiseEvent({
|
106
|
+
type: 'replay-finished'
|
107
|
+
});
|
108
|
+
smooth.subscribeToPins(currentSource.selectAvToPin("source"));
|
109
|
+
}
|
110
|
+
});
|
111
|
+
}
|
112
|
+
async sourceContextChange(_responseCallback) {
|
113
|
+
if (!this.currentSource) {
|
114
|
+
this.teardown();
|
115
|
+
return false;
|
116
|
+
}
|
117
|
+
const latestStreams = this.currentSource?.latestStreams();
|
118
|
+
if (latestStreams.length < 2) {
|
119
|
+
this.teardown();
|
120
|
+
return false;
|
121
|
+
}
|
122
|
+
const video = latestStreams.find((s) => s.metadata.message.case == 'video');
|
123
|
+
const audio = latestStreams.find((s) => s.metadata.message.case == 'audio');
|
124
|
+
if (!video || !audio) {
|
125
|
+
this.teardown();
|
126
|
+
return false;
|
127
|
+
}
|
128
|
+
const videoMetadata = video.metadata.message.value;
|
129
|
+
const audioMetadata = audio.metadata.message.value;
|
130
|
+
this.audioStreamKey = audio.metadata.streamKey;
|
131
|
+
this.videoStreamKey = video.metadata.streamKey;
|
132
|
+
(0, logging_1.infolog)("Action replay node has a valid context, spinning up some nodes", { videoMetadata, audioMetadata });
|
133
|
+
this.smooth = await this.norsk.processor.control.streamSwitchSmooth({
|
134
|
+
id: `${this.id}-switch`,
|
135
|
+
outputSource: `${this.id}-source`,
|
136
|
+
outputResolution: { width: videoMetadata.width, height: videoMetadata.height },
|
137
|
+
frameRate: videoMetadata.frameRate ?? { frames: 25, seconds: 1 },
|
138
|
+
sampleRate: audioMetadata.sampleRate,
|
139
|
+
channelLayout: audioMetadata.channelLayout ?? 'stereo',
|
140
|
+
hardwareAcceleration: (0, config_1.contractHardwareAcceleration)(this.cfg.__global.hardware, ["quadra", "nvidia"]),
|
141
|
+
activeSource: 'source',
|
142
|
+
transitionDurationMs: 500.0,
|
143
|
+
onInboundContextChange: async (ctx) => {
|
144
|
+
if (ctx.get('replay')?.length == 2) {
|
145
|
+
this.smooth?.switchSource('replay');
|
146
|
+
}
|
147
|
+
else {
|
148
|
+
this.smooth?.switchSource('source');
|
149
|
+
}
|
150
|
+
}
|
151
|
+
});
|
152
|
+
this.relatedMediaNodes.addInput(this.smooth);
|
153
|
+
const dir = (0, os_1.tmpdir)();
|
154
|
+
this.writer = await this.norsk.output.frameStore({
|
155
|
+
id: `${this.id}-store`,
|
156
|
+
name: `${this.id}-store`,
|
157
|
+
path: dir,
|
158
|
+
chunkFileDurationSeconds: 60,
|
159
|
+
});
|
160
|
+
this.videoEncode = await this.shared.previewEncode(this.currentSource.selectStreams((0, norsk_sdk_1.selectExactKey)(this.videoStreamKey))[0], this.cfg.__global.hardware);
|
161
|
+
this.audioEncode = await this.norsk.processor.transform.audioEncode({
|
162
|
+
id: `${this.id}-audio-encode`,
|
163
|
+
channelLayout: 'stereo',
|
164
|
+
bitrate: 64000,
|
165
|
+
outputRenditionName: `${this.id}-preview`,
|
166
|
+
codec: {
|
167
|
+
kind: 'aac',
|
168
|
+
sampleRate: audioMetadata.sampleRate,
|
169
|
+
profile: 'lc'
|
170
|
+
}
|
171
|
+
});
|
172
|
+
const localDestination = {
|
173
|
+
id: `${this.id}-local`,
|
174
|
+
type: 'local',
|
175
|
+
retentionPeriodSeconds: 360
|
176
|
+
};
|
177
|
+
this.audioCmaf = await this.norsk.output.cmafAudio({
|
178
|
+
id: `${this.id}-cmaf-audio`,
|
179
|
+
segmentDurationSeconds: 2,
|
180
|
+
partDurationSeconds: 0.5,
|
181
|
+
destinations: [localDestination]
|
182
|
+
});
|
183
|
+
this.videoCmaf = await this.norsk.output.cmafVideo({
|
184
|
+
id: `${this.id}-cmaf-video`,
|
185
|
+
segmentDurationSeconds: 2,
|
186
|
+
partDurationSeconds: 0.5,
|
187
|
+
destinations: [localDestination]
|
188
|
+
});
|
189
|
+
this.mvCmaf = await this.norsk.output.cmafMultiVariant({
|
190
|
+
id: `${this.id}-cmaf-mv`,
|
191
|
+
playlistName: `${this.id}-mv`,
|
192
|
+
destinations: [localDestination]
|
193
|
+
});
|
194
|
+
this.smooth.subscribeToPins(this.currentSource.selectAvToPin("source"), (ctx) => {
|
195
|
+
if (ctx.streams.length == 2)
|
196
|
+
return 'accept';
|
197
|
+
return 'deny';
|
198
|
+
});
|
199
|
+
this.audioEncode.subscribe(this.currentSource.selectAudio());
|
200
|
+
this.audioCmaf.subscribe([
|
201
|
+
{ source: this.audioEncode, sourceSelector: norsk_sdk_1.selectAudio }
|
202
|
+
]);
|
203
|
+
this.videoCmaf.subscribe([
|
204
|
+
{ source: this.videoEncode, sourceSelector: norsk_sdk_1.selectVideo }
|
205
|
+
]);
|
206
|
+
this.mvCmaf.subscribe([
|
207
|
+
{ source: this.audioCmaf, sourceSelector: norsk_sdk_1.selectPlaylist },
|
208
|
+
{ source: this.videoCmaf, sourceSelector: norsk_sdk_1.selectPlaylist },
|
209
|
+
]);
|
210
|
+
this.updates.raiseEvent({
|
211
|
+
type: 'content-player-created',
|
212
|
+
url: this.mvCmaf.url
|
213
|
+
});
|
214
|
+
this.passthrough?.subscribe([
|
215
|
+
{ source: this.smooth, sourceSelector: norsk_sdk_1.selectAV }
|
216
|
+
]);
|
217
|
+
this.writer.subscribe(this.currentSource.selectStreams());
|
218
|
+
return false;
|
219
|
+
}
|
220
|
+
teardown() {
|
221
|
+
}
|
222
|
+
}
|
223
|
+
exports.ActionReplay = ActionReplay;
|
224
|
+
//# sourceMappingURL=runtime.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/processor.actionReplay/runtime.ts"],"names":[],"mappings":";;;AAAA,qDAG+B;AAE/B,wFAA0M;AAE1M,mEAA6E;AAC7E,yEAA0F;AAC1F,2BAA4B;AAC5B,uEAAoH;AA+BpH,MAAqB,sBAAsB;IACzC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAuB,EAAE,EAA2B,EAAE,OAA4D;QAC3I,MAAM,IAAI,GAAG,IAAI,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,EAAE,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,aAAa,CAAC,IAAkB,EAAE,OAA4B;QAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;QAC7B,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,WAAW;gBACd,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACjD,MAAM;YACR;gBACE,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF;AAhBD,yCAgBC;AAED,MAAa,YAAY;IACvB,EAAE,CAAS;IACX,KAAK,CAAQ;IACb,GAAG,CAAqB;IACxB,WAAW,CAAgB;IAC3B,OAAO,CAAsD;IAC7D,MAAM,CAAe;IAErB,iBAAiB,GAAsB,IAAI,iCAAiB,EAAE,CAAC;IAK/D,MAAM,CAA+C;IAGrD,WAAW,CAAmB;IAC9B,WAAW,CAAmB;IAI9B,SAAS,CAAuB;IAChC,SAAS,CAAuB;IAChC,MAAM,CAA8B;IAGpC,MAAM,CAA0B;IAGhC,MAAM,CAAwB;IAE9B,aAAa,CAAgC;IAG7C,WAAW,CA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EAAE;SAC1D,CAAC,CAAA;QACF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;YACpB,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,0BAAc,EAAE;YAC1D,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,0BAAc,EAAE;SAC3D,CAAC,CAAA;QAEF,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACtB,IAAI,EAAE,wBAAwB;YAC9B,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG;SACrB,CAAC,CAAA;QAEF,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;YAC1B,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,oBAAQ,EAAE;SAClD,CAAC,CAAA;QAGF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC;QAG1D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ;IAER,CAAC;CACF;AA/PD,oCA+PC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import type { ActionReplayState, ActionReplayConfig, ActionReplayCommand } from "./runtime";
|
2
|
+
declare function InlineView({ state, config, sendCommand }: {
|
3
|
+
state: ActionReplayState;
|
4
|
+
config: ActionReplayConfig;
|
5
|
+
sendCommand: (cmd: ActionReplayCommand) => void;
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
7
|
+
export default InlineView;
|