@norskvideo/norsk-studio-built-ins 1.11.3 → 1.12.0-2025-01-27-b21c8c91
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 +16 -0
- package/client/info.js +1288 -788
- package/client/output.whep/styles.css +9 -0
- package/client/style.css +501 -863
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/info.js +5 -9
- package/lib/info.js.map +1 -1
- package/lib/input.rtmp/info.js +3 -2
- package/lib/input.rtmp/info.js.map +1 -1
- package/lib/input.rtmp/openApi.d.ts +133 -0
- package/lib/input.rtmp/openApi.js +3 -0
- package/lib/input.rtmp/openApi.js.map +1 -0
- package/lib/input.rtmp/runtime.d.ts +24 -5
- package/lib/input.rtmp/runtime.js +166 -60
- package/lib/input.rtmp/runtime.js.map +1 -1
- package/lib/input.rtmp/summary-view.d.ts +3 -5
- package/lib/input.rtmp/summary-view.js +26 -6
- package/lib/input.rtmp/summary-view.js.map +1 -1
- package/lib/input.rtmp/types.yaml +99 -0
- package/lib/input.silence/info.js +4 -3
- package/lib/input.silence/info.js.map +1 -1
- package/lib/input.srt-caller/info.js +7 -6
- package/lib/input.srt-caller/info.js.map +1 -1
- package/lib/input.srt-caller/runtime.d.ts +1 -1
- package/lib/input.srt-listener/info.js +8 -6
- package/lib/input.srt-listener/info.js.map +1 -1
- package/lib/input.srt-listener/openApi.d.ts +133 -0
- package/lib/input.srt-listener/openApi.js +3 -0
- package/lib/input.srt-listener/openApi.js.map +1 -0
- package/lib/input.srt-listener/runtime.d.ts +26 -6
- package/lib/input.srt-listener/runtime.js +168 -57
- package/lib/input.srt-listener/runtime.js.map +1 -1
- package/lib/input.srt-listener/summary-view.d.ts +3 -5
- package/lib/input.srt-listener/summary-view.js +28 -4
- package/lib/input.srt-listener/summary-view.js.map +1 -1
- package/lib/input.srt-listener/types.yaml +99 -0
- package/lib/input.udp-ts/info.d.ts +1 -1
- package/lib/input.udp-ts/info.js +6 -5
- package/lib/input.udp-ts/info.js.map +1 -1
- package/lib/input.udp-ts/runtime.d.ts +1 -1
- package/lib/input.videoTestCard/info.d.ts +1 -1
- package/lib/input.videoTestCard/info.js +15 -5
- package/lib/input.videoTestCard/info.js.map +1 -1
- package/lib/output.autoCmaf/form-views.js +2 -3
- package/lib/output.autoCmaf/form-views.js.map +1 -1
- package/lib/output.autoCmaf/info.d.ts +2 -2
- package/lib/output.autoCmaf/info.js +66 -8
- package/lib/output.autoCmaf/info.js.map +1 -1
- package/lib/output.autoCmaf/runtime.d.ts +29 -9
- package/lib/output.autoCmaf/runtime.js +198 -60
- package/lib/output.autoCmaf/runtime.js.map +1 -1
- package/lib/output.autoCmaf/summary.js +26 -1
- package/lib/output.autoCmaf/summary.js.map +1 -1
- package/lib/output.autoCmaf/types.d.ts +101 -0
- package/lib/output.autoCmaf/types.js +3 -0
- package/lib/output.autoCmaf/types.js.map +1 -0
- package/lib/output.autoCmaf/types.yaml +28 -0
- package/lib/output.preview/info.js +5 -3
- package/lib/output.preview/info.js.map +1 -1
- package/lib/output.preview/inline-view.d.ts +2 -4
- package/lib/output.preview/inline-view.js +8 -4
- package/lib/output.preview/inline-view.js.map +1 -1
- package/lib/output.preview/runtime.d.ts +4 -3
- package/lib/output.preview/runtime.js +29 -18
- package/lib/output.preview/runtime.js.map +1 -1
- package/lib/output.rtmp/info.js +2 -1
- package/lib/output.rtmp/info.js.map +1 -1
- package/lib/output.rtmp/inline-view.js +2 -2
- package/lib/output.rtmp/runtime.d.ts +2 -2
- package/lib/output.rtmp/runtime.js.map +1 -1
- package/lib/output.srt/info.d.ts +2 -2
- package/lib/output.srt/info.js +27 -6
- package/lib/output.srt/info.js.map +1 -1
- package/lib/output.srt/runtime.d.ts +30 -5
- package/lib/output.srt/runtime.js +139 -5
- package/lib/output.srt/runtime.js.map +1 -1
- package/lib/output.srt/types.d.ts +101 -0
- package/lib/output.srt/types.js +3 -0
- package/lib/output.srt/types.js.map +1 -0
- package/lib/output.srt/types.yaml +31 -0
- package/lib/output.statistics/info.js +3 -3
- package/lib/output.statistics/info.js.map +1 -1
- package/lib/output.statistics/inline-view.js +3 -2
- package/lib/output.statistics/inline-view.js.map +1 -1
- package/lib/output.statistics/runtime.d.ts +1 -1
- package/lib/output.statistics/runtime.js.map +1 -1
- package/lib/output.udpTs/info.d.ts +1 -1
- package/lib/output.udpTs/info.js +5 -4
- package/lib/output.udpTs/info.js.map +1 -1
- package/lib/output.udpTs/runtime.d.ts +1 -1
- package/lib/output.whep/info.d.ts +2 -2
- package/lib/output.whep/info.js +49 -1
- package/lib/output.whep/info.js.map +1 -1
- package/lib/output.whep/inline-view.d.ts +4 -0
- package/lib/output.whep/inline-view.js +24 -0
- package/lib/output.whep/inline-view.js.map +1 -0
- package/lib/output.whep/runtime.d.ts +26 -5
- package/lib/output.whep/runtime.js +64 -13
- package/lib/output.whep/runtime.js.map +1 -1
- package/lib/output.whep/types.d.ts +101 -0
- package/lib/output.whep/types.js +3 -0
- package/lib/output.whep/types.js.map +1 -0
- package/lib/output.whep/types.yaml +30 -0
- package/lib/processor.browserOverlay/info.d.ts +2 -2
- package/lib/processor.browserOverlay/info.js +57 -3
- package/lib/processor.browserOverlay/info.js.map +1 -1
- package/lib/processor.browserOverlay/inline-view.d.ts +6 -0
- package/lib/processor.browserOverlay/inline-view.js +8 -0
- package/lib/processor.browserOverlay/inline-view.js.map +1 -0
- package/lib/processor.browserOverlay/openApi.d.ts +174 -0
- package/lib/processor.browserOverlay/openApi.js +3 -0
- package/lib/processor.browserOverlay/openApi.js.map +1 -0
- package/lib/processor.browserOverlay/runtime.d.ts +40 -6
- package/lib/processor.browserOverlay/runtime.js +151 -23
- package/lib/processor.browserOverlay/runtime.js.map +1 -1
- package/lib/processor.browserOverlay/summary-view.d.ts +4 -0
- package/lib/processor.browserOverlay/summary-view.js +27 -0
- package/lib/processor.browserOverlay/summary-view.js.map +1 -0
- package/lib/processor.browserOverlay/types.yaml +65 -0
- package/lib/processor.cascadingSwitch/info.js +5 -4
- package/lib/processor.cascadingSwitch/info.js.map +1 -1
- package/lib/processor.cascadingSwitch/inline-view.js +3 -3
- package/lib/processor.cascadingSwitch/runtime.d.ts +1 -1
- package/lib/processor.cascadingSwitch/runtime.js +2 -2
- package/lib/processor.cascadingSwitch/runtime.js.map +1 -1
- package/lib/processor.fixedLadder/codec-editor.js +2 -2
- package/lib/processor.fixedLadder/codec-editor.js.map +1 -1
- package/lib/processor.fixedLadder/codec-view.js +2 -2
- package/lib/processor.fixedLadder/codec-view.js.map +1 -1
- package/lib/processor.fixedLadder/info.js +11 -9
- package/lib/processor.fixedLadder/info.js.map +1 -1
- package/lib/processor.fixedLadder/rung-view.js +2 -2
- package/lib/processor.fixedLadder/rung-view.js.map +1 -1
- package/lib/processor.onscreenGraphic/image-selection.d.ts +9 -0
- package/lib/{processor.dynamicBug/bug-selection.js → processor.onscreenGraphic/image-selection.js} +10 -10
- package/lib/processor.onscreenGraphic/image-selection.js.map +1 -0
- package/lib/processor.onscreenGraphic/info.d.ts +3 -0
- package/lib/{processor.dynamicBug → processor.onscreenGraphic}/info.js +24 -17
- package/lib/processor.onscreenGraphic/info.js.map +1 -0
- package/lib/processor.onscreenGraphic/runtime.d.ts +91 -0
- package/lib/processor.onscreenGraphic/runtime.js +503 -0
- package/lib/processor.onscreenGraphic/runtime.js.map +1 -0
- package/lib/processor.onscreenGraphic/summary-view.d.ts +4 -0
- package/lib/processor.onscreenGraphic/summary-view.js +343 -0
- package/lib/processor.onscreenGraphic/summary-view.js.map +1 -0
- package/lib/processor.onscreenGraphic/types.d.ts +271 -0
- package/lib/processor.onscreenGraphic/types.js +3 -0
- package/lib/processor.onscreenGraphic/types.js.map +1 -0
- package/lib/processor.onscreenGraphic/types.yaml +211 -0
- package/lib/processor.streamKeyOverride/info.d.ts +3 -0
- package/lib/processor.streamKeyOverride/info.js +150 -0
- package/lib/processor.streamKeyOverride/info.js.map +1 -0
- package/lib/processor.streamKeyOverride/runtime.d.ts +54 -0
- package/lib/processor.streamKeyOverride/runtime.js +226 -0
- package/lib/processor.streamKeyOverride/runtime.js.map +1 -0
- package/lib/shared/drm/axinom.d.ts +2 -0
- package/lib/shared/drm/axinom.js +120 -0
- package/lib/shared/drm/axinom.js.map +1 -0
- package/lib/shared/drm/cpix.d.ts +24 -0
- package/lib/shared/drm/cpix.js +97 -0
- package/lib/shared/drm/cpix.js.map +1 -0
- package/lib/shared/drm/ezdrm.d.ts +2 -0
- package/lib/shared/drm/ezdrm.js +26 -0
- package/lib/shared/drm/ezdrm.js.map +1 -0
- package/lib/shared/srt-form-views.js +1 -2
- package/lib/shared/srt-form-views.js.map +1 -1
- package/lib/shared/srt-socket-options.js +6 -6
- package/lib/shared/srt-socket-options.js.map +1 -1
- package/lib/shared/webrtcSettings.js +1 -2
- package/lib/shared/webrtcSettings.js.map +1 -1
- package/lib/test/auto-cmaf.js +25 -17
- package/lib/test/auto-cmaf.js.map +1 -1
- package/lib/test/browser-overlay.js +3 -2
- package/lib/test/browser-overlay.js.map +1 -1
- package/lib/test/{dynamic-bug.js → onscreen-graphic.js} +146 -114
- package/lib/test/onscreen-graphic.js.map +1 -0
- package/lib/test/preview.js +3 -3
- package/lib/test/preview.js.map +1 -1
- package/lib/test/rtmp-input.js +6 -3
- package/lib/test/rtmp-input.js.map +1 -1
- package/lib/test/srt-input-caller.js +5 -5
- package/lib/test/srt-input-caller.js.map +1 -1
- package/lib/test/srt-input-listener.js +99 -18
- package/lib/test/srt-input-listener.js.map +1 -1
- package/lib/test/srt-output.js +13 -5
- package/lib/test/srt-output.js.map +1 -1
- package/lib/test/udp-output.js +11 -4
- package/lib/test/udp-output.js.map +1 -1
- package/lib/test/udp-ts-input.js +2 -2
- package/lib/test/udp-ts-input.js.map +1 -1
- package/lib/test/whep-output.js +11 -5
- package/lib/test/whep-output.js.map +1 -1
- package/lib/{util.latency → util.stats.latency}/info.js +3 -2
- package/lib/util.stats.latency/info.js.map +1 -0
- package/lib/util.stats.latency/inline-view.js.map +1 -0
- package/lib/{util.latency → util.stats.latency}/runtime.d.ts +1 -1
- package/lib/{util.latency → util.stats.latency}/runtime.js +2 -2
- package/lib/util.stats.latency/runtime.js.map +1 -0
- package/lib/util.stats.latency/source-node-selection.js.map +1 -0
- package/package.json +12 -5
- package/lib/processor.dynamicBug/bug-selection.d.ts +0 -9
- package/lib/processor.dynamicBug/bug-selection.js.map +0 -1
- package/lib/processor.dynamicBug/info.d.ts +0 -3
- package/lib/processor.dynamicBug/info.js.map +0 -1
- package/lib/processor.dynamicBug/runtime.d.ts +0 -64
- package/lib/processor.dynamicBug/runtime.js +0 -304
- package/lib/processor.dynamicBug/runtime.js.map +0 -1
- package/lib/processor.dynamicBug/summary-view.d.ts +0 -4
- package/lib/processor.dynamicBug/summary-view.js +0 -60
- package/lib/processor.dynamicBug/summary-view.js.map +0 -1
- package/lib/processor.whisper-transcribe/info.d.ts +0 -3
- package/lib/processor.whisper-transcribe/info.js +0 -43
- package/lib/processor.whisper-transcribe/info.js.map +0 -1
- package/lib/processor.whisper-transcribe/runtime.d.ts +0 -29
- package/lib/processor.whisper-transcribe/runtime.js +0 -83
- package/lib/processor.whisper-transcribe/runtime.js.map +0 -1
- package/lib/test/dynamic-bug.js.map +0 -1
- package/lib/util.latency/info.js.map +0 -1
- package/lib/util.latency/inline-view.js.map +0 -1
- package/lib/util.latency/runtime.js.map +0 -1
- package/lib/util.latency/source-node-selection.js.map +0 -1
- package/lib/util.ma35d/info.d.ts +0 -3
- package/lib/util.ma35d/info.js +0 -78
- package/lib/util.ma35d/info.js.map +0 -1
- package/lib/util.ma35d/inline-view.d.ts +0 -6
- package/lib/util.ma35d/inline-view.js +0 -76
- package/lib/util.ma35d/inline-view.js.map +0 -1
- package/lib/util.ma35d/runtime.d.ts +0 -21
- package/lib/util.ma35d/runtime.js +0 -49
- package/lib/util.ma35d/runtime.js.map +0 -1
- package/lib/util.timestamps/info.d.ts +0 -5
- package/lib/util.timestamps/info.js +0 -86
- package/lib/util.timestamps/info.js.map +0 -1
- package/lib/util.timestamps/inline-view.d.ts +0 -6
- package/lib/util.timestamps/inline-view.js +0 -94
- package/lib/util.timestamps/inline-view.js.map +0 -1
- package/lib/util.timestamps/runtime.d.ts +0 -29
- package/lib/util.timestamps/runtime.js +0 -40
- package/lib/util.timestamps/runtime.js.map +0 -1
- /package/lib/test/{dynamic-bug.d.ts → onscreen-graphic.d.ts} +0 -0
- /package/lib/{util.latency → util.stats.latency}/info.d.ts +0 -0
- /package/lib/{util.latency → util.stats.latency}/inline-view.d.ts +0 -0
- /package/lib/{util.latency → util.stats.latency}/inline-view.js +0 -0
- /package/lib/{util.latency → util.stats.latency}/source-node-selection.d.ts +0 -0
- /package/lib/{util.latency → util.stats.latency}/source-node-selection.js +0 -0
package/lib/output.srt/info.js
CHANGED
@@ -26,11 +26,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
27
|
};
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
exports.default = default_1;
|
29
30
|
const react_1 = __importDefault(require("react"));
|
30
31
|
const srt_socket_options_1 = __importDefault(require("../shared/srt-socket-options"));
|
32
|
+
const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
|
31
33
|
function default_1(registration) {
|
32
34
|
const { defineComponent, All, validation, } = registration;
|
33
|
-
const { Port,
|
35
|
+
const { Port, Hostname, JitterBuffer, SrtPassphrase, SrtStreamId } = validation;
|
34
36
|
const SocketConfiguration = react_1.default.lazy(async () => {
|
35
37
|
const views = await Promise.resolve().then(() => __importStar(require('../shared/srt-form-views')));
|
36
38
|
return { default: views.SocketConfiguration };
|
@@ -39,6 +41,7 @@ function default_1(registration) {
|
|
39
41
|
identifier: 'output.srt',
|
40
42
|
category: 'output',
|
41
43
|
name: "SRT Egest",
|
44
|
+
description: "This component manages the sending of SRT (Secure Reliable Transport) streams. It allows you to configure various settings to control how the SRT output is handled, including connection details, buffer settings, and delay options.",
|
42
45
|
subscription: {
|
43
46
|
accepts: {
|
44
47
|
type: "multi-stream",
|
@@ -48,11 +51,30 @@ function default_1(registration) {
|
|
48
51
|
display: (desc) => {
|
49
52
|
return {
|
50
53
|
port: desc.config.port?.toString() ?? '',
|
51
|
-
|
54
|
+
host: desc.config.host,
|
52
55
|
mode: desc.config.mode,
|
53
56
|
bufferDelayMs: desc.config.bufferDelayMs?.toString() ?? 'none'
|
54
57
|
};
|
55
58
|
},
|
59
|
+
runtime: {
|
60
|
+
initialState: () => ({
|
61
|
+
enabled: true,
|
62
|
+
}),
|
63
|
+
handleEvent(ev, state) {
|
64
|
+
const evType = ev.type;
|
65
|
+
switch (evType) {
|
66
|
+
case 'output-enabled':
|
67
|
+
state.enabled = true;
|
68
|
+
break;
|
69
|
+
case 'output-disabled':
|
70
|
+
state.enabled = false;
|
71
|
+
break;
|
72
|
+
default:
|
73
|
+
(0, util_1.assertUnreachable)(evType);
|
74
|
+
}
|
75
|
+
return { ...state };
|
76
|
+
},
|
77
|
+
},
|
56
78
|
configForm: {
|
57
79
|
form: {
|
58
80
|
port: {
|
@@ -68,7 +90,7 @@ function default_1(registration) {
|
|
68
90
|
},
|
69
91
|
}
|
70
92
|
},
|
71
|
-
|
93
|
+
host: { help: "The IP address/Hostname this SRT output will connect to or listen on", hint: { type: 'text', validation: Hostname, defaultValue: "0.0.0.0" } },
|
72
94
|
bufferDelayMs: { help: "How many milliseconds in the jitter buffer", hint: { type: 'numeric', validation: JitterBuffer, defaultValue: 500.0 } },
|
73
95
|
avDelayMs: { help: "How many milliseconds to delay A/V to account for subtitles/ancillary data", hint: { type: 'numeric', validation: JitterBuffer, defaultValue: 50.0 } },
|
74
96
|
mode: {
|
@@ -84,8 +106,8 @@ function default_1(registration) {
|
|
84
106
|
}]
|
85
107
|
}
|
86
108
|
},
|
87
|
-
passphrase: { help: "Optional: Authentication for this SRT output", hint: { type: 'text', validation: SrtPassphrase } },
|
88
|
-
streamId: { help: "Optional: StreamId to use when calling a remote listener", hint: { type: 'text', validation: SrtStreamId } },
|
109
|
+
passphrase: { help: "Optional: Authentication for this SRT output", hint: { type: 'text', optional: true, validation: SrtPassphrase } },
|
110
|
+
streamId: { help: "Optional: StreamId to use when calling a remote listener", hint: { type: 'text', optional: true, validation: SrtStreamId } },
|
89
111
|
socketOptions: {
|
90
112
|
help: "Socket Options",
|
91
113
|
hint: {
|
@@ -98,5 +120,4 @@ function default_1(registration) {
|
|
98
120
|
}
|
99
121
|
});
|
100
122
|
}
|
101
|
-
exports.default = default_1;
|
102
123
|
//# sourceMappingURL=info.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.srt/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.srt/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,4BAgGC;AApGD,kDAA0B;AAC1B,sFAA4D;AAC5D,mEAA6E;AAE7E,mBAAwB,YAA0B;IAChD,MAAM,EACJ,eAAe,EACf,GAAG,EACH,UAAU,GACX,GAAG,YAAY,CAAC;IACjB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC;IAChF,MAAM,mBAAmB,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;QAChD,MAAM,KAAK,GAAG,wDAAa,0BAA0B,GAAC,CAAA;QACtD,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,mBAAmB,EAAE,CAAA;IAC/C,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAsE;QAC1F,UAAU,EAAE,YAAY;QACxB,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,wOAAwO;QACrP,YAAY,EAAE;YAGZ,OAAO,EAAE;gBACP,IAAI,E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
@@ -1,12 +1,37 @@
|
|
1
1
|
import { Norsk, SrtOutputSettings as SdkSettings } from '@norskvideo/norsk-sdk';
|
2
|
-
import { OnCreated, ServerComponentDefinition } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
-
import {
|
2
|
+
import { InstanceRouteInfo, OnCreated, ServerComponentDefinition, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { CustomSinkNode } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
4
|
import type { SocketOptions } from '../shared/srt-types';
|
5
|
-
export type SrtOutputSettings = Pick<SdkSettings, 'port' | '
|
5
|
+
export type SrtOutputSettings = Pick<SdkSettings, 'port' | 'host' | 'mode' | 'passphrase' | 'streamId' | 'bufferDelayMs' | 'avDelayMs'> & {
|
6
6
|
id: string;
|
7
7
|
displayName: string;
|
8
8
|
socketOptions: SocketOptions;
|
9
9
|
};
|
10
|
-
export
|
11
|
-
|
10
|
+
export type SrtOutputState = {
|
11
|
+
enabled: boolean;
|
12
|
+
};
|
13
|
+
export type SrtOutputCommand = {
|
14
|
+
type: 'enable-output' | 'disable-output';
|
15
|
+
};
|
16
|
+
export type SrtOutputEvent = {
|
17
|
+
type: 'output-enabled' | 'output-disabled';
|
18
|
+
};
|
19
|
+
declare class SrtOutput extends CustomSinkNode {
|
20
|
+
norsk: Norsk;
|
21
|
+
cfg: SrtOutputSettings;
|
22
|
+
enabled: boolean;
|
23
|
+
initialised: Promise<void>;
|
24
|
+
nodeCounter: number;
|
25
|
+
static create(norsk: Norsk, cfg: SrtOutputSettings): Promise<SrtOutput>;
|
26
|
+
constructor(cfg: SrtOutputSettings, norsk: Norsk);
|
27
|
+
initialise(): Promise<void>;
|
28
|
+
enableOutput(): Promise<void>;
|
29
|
+
disableOutput(): Promise<void>;
|
30
|
+
incrementNodeId(id: string): string;
|
31
|
+
}
|
32
|
+
export default class SrtOutputDefinition implements ServerComponentDefinition<SrtOutputSettings, SrtOutput, SrtOutputState, SrtOutputCommand, SrtOutputEvent> {
|
33
|
+
create(norsk: Norsk, cfg: SrtOutputSettings, cb: OnCreated<SrtOutput>, runtime: StudioRuntime<SrtOutputState, SrtOutputCommand, SrtOutputEvent>): Promise<void>;
|
34
|
+
handleCommand(node: SrtOutput, command: SrtOutputCommand): Promise<void>;
|
35
|
+
instanceRoutes(): Promise<InstanceRouteInfo<SrtOutputSettings, SrtOutput, SrtOutputState, SrtOutputCommand, SrtOutputEvent>[]>;
|
12
36
|
}
|
37
|
+
export {};
|
@@ -1,13 +1,147 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
const base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
|
7
|
+
const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
|
8
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
9
|
+
const json_refs_1 = require("json-refs");
|
10
|
+
const path_1 = __importDefault(require("path"));
|
11
|
+
const yaml_1 = __importDefault(require("yaml"));
|
12
|
+
function coreInfo(path, op) {
|
13
|
+
return {
|
14
|
+
url: path,
|
15
|
+
summary: op.summary,
|
16
|
+
description: op.description,
|
17
|
+
requestBody: op.requestBody,
|
18
|
+
responses: op.responses,
|
19
|
+
};
|
20
|
+
}
|
21
|
+
function post(path, paths) {
|
22
|
+
return {
|
23
|
+
...coreInfo(path, paths[path]['post']),
|
24
|
+
method: 'POST',
|
25
|
+
};
|
26
|
+
}
|
27
|
+
class SrtOutput extends base_nodes_1.CustomSinkNode {
|
28
|
+
norsk;
|
29
|
+
cfg;
|
30
|
+
enabled = true;
|
31
|
+
initialised;
|
32
|
+
nodeCounter = 0;
|
33
|
+
static async create(norsk, cfg) {
|
34
|
+
const node = new SrtOutput(cfg, norsk);
|
35
|
+
await node.initialised;
|
36
|
+
return node;
|
37
|
+
}
|
38
|
+
constructor(cfg, norsk) {
|
39
|
+
super(cfg.id);
|
40
|
+
this.cfg = cfg;
|
41
|
+
this.norsk = norsk;
|
42
|
+
this.initialised = this.initialise();
|
43
|
+
}
|
44
|
+
async initialise() {
|
45
|
+
const node = await this.norsk.output.srt({
|
46
|
+
...this.cfg,
|
47
|
+
...this.cfg.socketOptions,
|
48
|
+
id: this.incrementNodeId(this.cfg.id),
|
49
|
+
});
|
50
|
+
this.setup({ sink: node });
|
51
|
+
}
|
52
|
+
async enableOutput() {
|
53
|
+
if (!this.enabled) {
|
54
|
+
this.enabled = true;
|
55
|
+
await this.initialise();
|
56
|
+
(0, logging_1.debuglog)("Output enabled", { id: this.id });
|
57
|
+
}
|
58
|
+
}
|
59
|
+
async disableOutput() {
|
60
|
+
if (this.enabled) {
|
61
|
+
this.enabled = false;
|
62
|
+
await this.close();
|
63
|
+
(0, logging_1.debuglog)("Output disabled", { id: this.id });
|
64
|
+
}
|
65
|
+
}
|
66
|
+
incrementNodeId(id) {
|
67
|
+
this.nodeCounter++;
|
68
|
+
return `${id}-${this.nodeCounter}`;
|
69
|
+
}
|
70
|
+
}
|
4
71
|
class SrtOutputDefinition {
|
5
|
-
async create(norsk, cfg, cb) {
|
6
|
-
const
|
7
|
-
|
72
|
+
async create(norsk, cfg, cb, runtime) {
|
73
|
+
const node = await SrtOutput.create(norsk, cfg);
|
74
|
+
cb(node);
|
75
|
+
runtime.updates.raiseEvent({
|
76
|
+
type: 'output-enabled'
|
8
77
|
});
|
9
|
-
|
10
|
-
|
78
|
+
runtime.updates.update({
|
79
|
+
enabled: true,
|
80
|
+
});
|
81
|
+
}
|
82
|
+
async handleCommand(node, command) {
|
83
|
+
switch (command.type) {
|
84
|
+
case 'enable-output':
|
85
|
+
await node.enableOutput();
|
86
|
+
break;
|
87
|
+
case 'disable-output':
|
88
|
+
await node.disableOutput();
|
89
|
+
break;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
async instanceRoutes() {
|
93
|
+
const types = await promises_1.default.readFile(path_1.default.join(__dirname, 'types.yaml'));
|
94
|
+
const root = yaml_1.default.parse(types.toString());
|
95
|
+
const resolved = await (0, json_refs_1.resolveRefs)(root, {}).then((r) => r.resolved);
|
96
|
+
const paths = resolved.paths;
|
97
|
+
return [
|
98
|
+
{
|
99
|
+
...post('/enable', paths),
|
100
|
+
handler: ({ runtime }) => async (_req, res) => {
|
101
|
+
try {
|
102
|
+
const state = runtime.updates.latest();
|
103
|
+
if (state.enabled) {
|
104
|
+
return res.status(400).json({ error: 'Output is already enabled' });
|
105
|
+
}
|
106
|
+
runtime.updates.update({ ...state, enabled: true });
|
107
|
+
runtime.updates.sendCommand({
|
108
|
+
type: 'enable-output'
|
109
|
+
});
|
110
|
+
runtime.updates.raiseEvent({
|
111
|
+
type: 'output-enabled'
|
112
|
+
});
|
113
|
+
res.sendStatus(204);
|
114
|
+
}
|
115
|
+
catch (error) {
|
116
|
+
console.error('Error in enable handler:', error);
|
117
|
+
res.status(500).json({ error: 'Failed to enable output' });
|
118
|
+
}
|
119
|
+
}
|
120
|
+
},
|
121
|
+
{
|
122
|
+
...post('/disable', paths),
|
123
|
+
handler: ({ runtime }) => async (_req, res) => {
|
124
|
+
try {
|
125
|
+
const state = runtime.updates.latest();
|
126
|
+
if (!state.enabled) {
|
127
|
+
return res.status(400).json({ error: 'Output is already disabled' });
|
128
|
+
}
|
129
|
+
runtime.updates.update({ ...state, enabled: false });
|
130
|
+
runtime.updates.sendCommand({
|
131
|
+
type: 'disable-output'
|
132
|
+
});
|
133
|
+
runtime.updates.raiseEvent({
|
134
|
+
type: 'output-disabled'
|
135
|
+
});
|
136
|
+
res.sendStatus(204);
|
137
|
+
}
|
138
|
+
catch (error) {
|
139
|
+
console.error('Error in disable handler:', error);
|
140
|
+
res.status(500).json({ error: 'Failed to disable output' });
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
];
|
11
145
|
}
|
12
146
|
}
|
13
147
|
exports.default = SrtOutputDefinition;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.srt/runtime.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.srt/runtime.ts"],"names":[],"mappings":";;;;;AAEA,kFAAmF;AACnF,yEAAuE;AAGvE,2DAA6B;AAC7B,yCAAwC;AACxC,gDAAwB;AACxB,gDAAwB;AAyBxB,SAAS,QAAQ,CAAI,IAAa,EAAE,EAA6B;IAC/D,OAAO;QACL,GAAG,EAAE,IAAI;QACT,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,WAAW,EAAE,EAAE,CAAC,WAAW;QAC3B,WAAW,EAAE,EAAE,CAAC,WAAW;QAC3B,SAAS,EAAE,EAAE,CAAC,SAAS;KACxB,CAAA;AACH,CAAC;AAED,SAAS,IAAI,CAAI,IAAa,EAAE,KAAoB;IAClD,OAAO;QACL,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAE,CAAC;QACvC,MAAM,EAAE,MAAe;KACxB,CAAA;AACH,CAAC;AAED,MAAM,SAAU,SAAQ,2BAAc;IACpC,KAAK,CAAQ;IACb,GAAG,CAAoB;IACvB,OAAO,GAAY,IAAI,CAAC;IACxB,WAAW,CAAgB;IAC3B,WAAW,GAAW,CAAC,CAAC;IAExB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAsB;QACtD,MAAM,IAAI,GAAG,IAAI,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACvC,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,GAAsB,EAAE,KAAY;QAC9C,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;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,KAAK,EAAE,CAAC,CAAC;wBAErD,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;4BAC1B,IAAI,EAAE,gBAAgB;yBACvB,CAAC,CAAC;wBAEH,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;4BACzB,IAAI,EAAE,iBAAiB;yBACxB,CAAC,CAAC;wBAEH,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBACtB,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;wBAClD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;oBAC9D,CAAC;gBACH,CAAC;aACF;SACF,CAAC;IACJ,CAAC;CACF;AApFD,sCAoFC"}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
export interface paths {
|
2
|
+
"/enable": {
|
3
|
+
parameters: {
|
4
|
+
query?: never;
|
5
|
+
header?: never;
|
6
|
+
path?: never;
|
7
|
+
cookie?: never;
|
8
|
+
};
|
9
|
+
get?: never;
|
10
|
+
put?: never;
|
11
|
+
post: {
|
12
|
+
parameters: {
|
13
|
+
query?: never;
|
14
|
+
header?: never;
|
15
|
+
path?: never;
|
16
|
+
cookie?: never;
|
17
|
+
};
|
18
|
+
requestBody?: never;
|
19
|
+
responses: {
|
20
|
+
204: {
|
21
|
+
headers: {
|
22
|
+
[name: string]: unknown;
|
23
|
+
};
|
24
|
+
content?: never;
|
25
|
+
};
|
26
|
+
400: {
|
27
|
+
headers: {
|
28
|
+
[name: string]: unknown;
|
29
|
+
};
|
30
|
+
content?: never;
|
31
|
+
};
|
32
|
+
500: {
|
33
|
+
headers: {
|
34
|
+
[name: string]: unknown;
|
35
|
+
};
|
36
|
+
content?: never;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
};
|
40
|
+
delete?: never;
|
41
|
+
options?: never;
|
42
|
+
head?: never;
|
43
|
+
patch?: never;
|
44
|
+
trace?: never;
|
45
|
+
};
|
46
|
+
"/disable": {
|
47
|
+
parameters: {
|
48
|
+
query?: never;
|
49
|
+
header?: never;
|
50
|
+
path?: never;
|
51
|
+
cookie?: never;
|
52
|
+
};
|
53
|
+
get?: never;
|
54
|
+
put?: never;
|
55
|
+
post: {
|
56
|
+
parameters: {
|
57
|
+
query?: never;
|
58
|
+
header?: never;
|
59
|
+
path?: never;
|
60
|
+
cookie?: never;
|
61
|
+
};
|
62
|
+
requestBody?: never;
|
63
|
+
responses: {
|
64
|
+
204: {
|
65
|
+
headers: {
|
66
|
+
[name: string]: unknown;
|
67
|
+
};
|
68
|
+
content?: never;
|
69
|
+
};
|
70
|
+
400: {
|
71
|
+
headers: {
|
72
|
+
[name: string]: unknown;
|
73
|
+
};
|
74
|
+
content?: never;
|
75
|
+
};
|
76
|
+
500: {
|
77
|
+
headers: {
|
78
|
+
[name: string]: unknown;
|
79
|
+
};
|
80
|
+
content?: never;
|
81
|
+
};
|
82
|
+
};
|
83
|
+
};
|
84
|
+
delete?: never;
|
85
|
+
options?: never;
|
86
|
+
head?: never;
|
87
|
+
patch?: never;
|
88
|
+
trace?: never;
|
89
|
+
};
|
90
|
+
}
|
91
|
+
export type webhooks = Record<string, never>;
|
92
|
+
export interface components {
|
93
|
+
schemas: never;
|
94
|
+
responses: never;
|
95
|
+
parameters: never;
|
96
|
+
requestBodies: never;
|
97
|
+
headers: never;
|
98
|
+
pathItems: never;
|
99
|
+
}
|
100
|
+
export type $defs = Record<string, never>;
|
101
|
+
export type operations = Record<string, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/output.srt/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
title: Srt Output Component
|
4
|
+
version: 1.0.0
|
5
|
+
|
6
|
+
|
7
|
+
paths:
|
8
|
+
/enable:
|
9
|
+
post:
|
10
|
+
summary: Enable SRT output
|
11
|
+
description: Enables output if currently disabled
|
12
|
+
x-route-type: instance
|
13
|
+
responses:
|
14
|
+
204:
|
15
|
+
description: Output successfully enabled
|
16
|
+
400:
|
17
|
+
description: Output is already enabled
|
18
|
+
500:
|
19
|
+
description: Server error while enabling output
|
20
|
+
/disable:
|
21
|
+
post:
|
22
|
+
summary: Disable SRT output
|
23
|
+
description: Disables output if currently enabled
|
24
|
+
x-route-type: instance
|
25
|
+
responses:
|
26
|
+
204:
|
27
|
+
description: Output successfully disabled
|
28
|
+
400:
|
29
|
+
description: Output is already disabled
|
30
|
+
500:
|
31
|
+
description: Server error while disabling output
|
@@ -26,7 +26,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
27
|
};
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.
|
29
|
+
exports.default = default_1;
|
30
|
+
exports.assertUnreachable = assertUnreachable;
|
30
31
|
const react_1 = __importDefault(require("react"));
|
31
32
|
function default_1({ defineComponent, All }) {
|
32
33
|
const InlineView = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./inline-view'))));
|
@@ -34,6 +35,7 @@ function default_1({ defineComponent, All }) {
|
|
34
35
|
identifier: 'output.statistics',
|
35
36
|
category: 'output',
|
36
37
|
name: "Statistics",
|
38
|
+
description: "This component accepts multiple media streams, captures and reports metrics or statistical data related to the media streams.",
|
37
39
|
subscription: {
|
38
40
|
accepts: {
|
39
41
|
type: "multi-stream",
|
@@ -61,9 +63,7 @@ function default_1({ defineComponent, All }) {
|
|
61
63
|
}
|
62
64
|
});
|
63
65
|
}
|
64
|
-
exports.default = default_1;
|
65
66
|
function assertUnreachable(_) {
|
66
67
|
throw new Error("Didn't expect to get here");
|
67
68
|
}
|
68
|
-
exports.assertUnreachable = assertUnreachable;
|
69
69
|
//# sourceMappingURL=info.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.statistics/info.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.statistics/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,4BAuCC;AAED,8CAEC;AA/CD,kDAA0B;AAI1B,mBAAwB,EACtB,eAAe,EACf,GAAG,EACU;IAEb,MAAM,UAAU,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,eAAe,GAAC,CAAC,CAAC;IAEnE,OAAO,eAAe,CAAkG;QACtH,UAAU,EAAE,mBAAmB;QAC/B,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,+HAA+H;QAC5I,YAAY,EAAE;YAEZ,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,GAAG;aACX;SACF;QACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;QAClC,OAAO,EAAE;YACP,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;YACxB,WAAW,CAAC,EAAE,EAAE,KAAK;gBACnB,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC;gBACvB,QAAQ,MAAM,EAAE,CAAC;oBACf,KAAK,SAAS;wBACZ,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC;wBAC5B,MAAM;oBACR;wBACE,iBAAiB,CAAC,MAAM,CAAC,CAAC;gBAC9B,CAAC;gBACD,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;YACtB,CAAC;YACD,MAAM,EAAE,UAAU;SACnB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,EAAE;SACT;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,iBAAiB,CAAC,CAAQ;IACxC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC"}
|
@@ -5,13 +5,14 @@ const info_1 = require("./info");
|
|
5
5
|
function InlineView({ state }) {
|
6
6
|
if (!state.previous)
|
7
7
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
8
|
+
const format = (stat) => Math.floor(stat).toLocaleString('en-US', { maximumFractionDigits: 0 });
|
8
9
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: state.previous.allStreams.map((s, i) => {
|
9
10
|
const metaCase = s.metadata.case;
|
10
11
|
switch (metaCase) {
|
11
12
|
case "audio":
|
12
|
-
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["StreamKey: ", streamKey(s.streamKey)] }), (0, jsx_runtime_1.jsxs)("div", { children: ["Bitrate: ",
|
13
|
+
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["StreamKey: ", streamKey(s.streamKey)] }), (0, jsx_runtime_1.jsxs)("div", { children: ["Bitrate: ", format(s.bitrate), "bps"] })] }, i);
|
13
14
|
case "video":
|
14
|
-
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["StreamKey: ", streamKey(s.streamKey)] }), (0, jsx_runtime_1.jsxs)("div", { children: ["Bitrate: ",
|
15
|
+
return (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["StreamKey: ", streamKey(s.streamKey)] }), (0, jsx_runtime_1.jsxs)("div", { children: ["Bitrate: ", format(s.bitrate), "bps"] })] }, i);
|
15
16
|
case "ancillary":
|
16
17
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
17
18
|
case "subtitle":
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"inline-view.js","sourceRoot":"","sources":["../../src/output.statistics/inline-view.tsx"],"names":[],"mappings":";;;AAAA,i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BAAiB,EAAC,QAAQ,CAAC,CAAC;YAChC,CAAC;QACH,CAAC,CAAC,GACD,CAAA;AACL,CAAC;AACD,SAAS,SAAS,CAAC,SAAoB;IACrC,OAAO,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACvC,CAAC;AAED,kBAAe,UAAU,CAAC"}
|
@@ -14,5 +14,5 @@ export type StatisticsOutputEvent = {
|
|
14
14
|
};
|
15
15
|
export type StatisticsOutputCommand = object;
|
16
16
|
export default class StatisticsOutputDefinition implements ServerComponentDefinition<StatisticsOutputSettings, SimpleSinkWrapper, StatisticsOutputState, StatisticsOutputCommand, StatisticsOutputEvent> {
|
17
|
-
create(norsk: Norsk, cfg: StatisticsOutputSettings, cb: OnCreated<SimpleSinkWrapper>, { updates }: StudioRuntime<StatisticsOutputState, StatisticsOutputEvent>): Promise<void>;
|
17
|
+
create(norsk: Norsk, cfg: StatisticsOutputSettings, cb: OnCreated<SimpleSinkWrapper>, { updates }: StudioRuntime<StatisticsOutputState, StatisticsOutputCommand, StatisticsOutputEvent>): Promise<void>;
|
18
18
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.statistics/runtime.ts"],"names":[],"mappings":";;AAGA,kFAAsG;AAmBtG,MAAqB,0BAA0B;IAC7C,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAA6B,EAAE,EAAgC,EAAE,EAAE,OAAO,
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.statistics/runtime.ts"],"names":[],"mappings":";;AAGA,kFAAsG;AAmBtG,MAAqB,0BAA0B;IAC7C,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAA6B,EAAE,EAAgC,EAAE,EAAE,OAAO,EAAwF;QAC3L,MAAM,IAAI,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACvD,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,EAAE,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;CACF;AAND,6CAMC;AAED,MAAM,gBAAiB,SAAQ,2BAAc;IAC3C,WAAW,CAAgB;IAC3B,KAAK,CAAQ;IACb,OAAO,CAAwF;IAE/F,GAAG,CAA2B;IAE9B,YAAY,KAAY,EAAE,OAA8F,EAAE,GAA6B;QACrJ,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC;YAC/D,kBAAkB,EAAE,CAAC,KAA4B,EAAE,EAAE;gBACnD,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;oBACtB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,KAAK;iBACf,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7B,CAAC;CACF"}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { UdpTsOutputSettings } from "./runtime";
|
2
2
|
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
3
|
-
export default function ({ defineComponent, All, validation: { Port,
|
3
|
+
export default function ({ defineComponent, All, validation: { Port, Hostname, JitterBuffer, Iface, Z }, }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<UdpTsOutputSettings, object, object, object>;
|
package/lib/output.udpTs/info.js
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
3
|
+
exports.default = default_1;
|
4
|
+
function default_1({ defineComponent, All, validation: { Port, Hostname, JitterBuffer, Iface, Z }, }) {
|
4
5
|
return defineComponent({
|
5
6
|
identifier: 'output.udpTs',
|
6
7
|
category: 'output',
|
7
8
|
name: "UDP TS Egest",
|
9
|
+
description: "This component outputs multiple media streams over UDP in TS (Transport Stream) format. It accepts multiple input streams and sends them to a specified IP address and port.",
|
8
10
|
subscription: {
|
9
11
|
accepts: {
|
10
12
|
type: 'multi-stream',
|
@@ -14,7 +16,7 @@ function default_1({ defineComponent, All, validation: { Port, IpAddress, Jitter
|
|
14
16
|
display: (desc) => {
|
15
17
|
return {
|
16
18
|
port: desc.config.port.toString(),
|
17
|
-
destinationIp: desc.config.
|
19
|
+
destinationIp: desc.config.destinationHost,
|
18
20
|
interface: desc.config.interface,
|
19
21
|
bufferDelayMs: desc.config.bufferDelayMs?.toString() ?? 'none'
|
20
22
|
};
|
@@ -22,12 +24,11 @@ function default_1({ defineComponent, All, validation: { Port, IpAddress, Jitter
|
|
22
24
|
configForm: {
|
23
25
|
form: {
|
24
26
|
port: { help: "The port this UDP TS output will send to", hint: { type: 'numeric', validation: Port, defaultValue: 8001 } },
|
25
|
-
|
27
|
+
destinationHost: { help: "The IP address/Hostname this UDP TS output will send to", hint: { type: 'text', validation: Hostname, defaultValue: "127.0.0.1" } },
|
26
28
|
bufferDelayMs: { help: "How many milliseconds in the jitter buffer", hint: { type: 'numeric', validation: JitterBuffer, defaultValue: 500.0 } },
|
27
29
|
interface: { help: "Which interface to bind to for publishing", hint: { type: 'text', validation: Z.union([Z.string().length(0), Iface]), defaultValue: "any" } },
|
28
30
|
}
|
29
31
|
}
|
30
32
|
});
|
31
33
|
}
|
32
|
-
exports.default = default_1;
|
33
34
|
//# sourceMappingURL=info.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.udpTs/info.ts"],"names":[],"mappings":";;AA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EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE;gBAC/I,SAAS,EAAE,EAAE,IAAI,EAAE,2CAA2C,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE;aAClK;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Norsk, UdpTsOutputSettings as SdkSettings } from '@norskvideo/norsk-sdk';
|
2
2
|
import { OnCreated, ServerComponentDefinition } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
3
|
import { SimpleSinkWrapper } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
|
-
export type UdpTsOutputSettings = Pick<SdkSettings, 'port' | '
|
4
|
+
export type UdpTsOutputSettings = Pick<SdkSettings, 'port' | 'destinationHost' | 'interface' | 'bufferDelayMs' | 'avDelayMs'> & {
|
5
5
|
id: string;
|
6
6
|
displayName: string;
|
7
7
|
};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type
|
1
|
+
import { type WhepOutputEvent, type WhepOutputSettings, type WhepOutputState } from "./runtime";
|
2
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<WhepOutputSettings,
|
3
|
+
export default function (R: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<WhepOutputSettings, WhepOutputState, object, WhepOutputEvent>;
|